RDMA/mlx5: Fix memory leak in GET_DATA_DIRECT_SYSFS_PATH handler
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
RDMA/mlx5: Fix memory leak in GET_DATA_DIRECT_SYSFS_PATH handler
The UVERBS_HANDLER(MLX5_IB_METHOD_GET_DATA_DIRECT_SYSFS_PATH) function allocates memory for the device path using kobject_get_path(). If the length of the device path exceeds the output buffer length, the function returns -ENOSPC but does not free the allocated memory, resulting in a memory leak.
Add a kfree() call to the error path to ensure the allocated memory is properly freed.
Compile tested only. Issue found using a prototype static analysis tool and code review.
From the CVE record · Linux
The Linux kernel’s RDMA/mlx5 handler leaks allocated memory when a device path exceeds the output buffer length. A request that triggers this error leaves the memory unfreed; the input does not specify whether an attacker can reach the handler, whether authentication or user interaction is needed, or any resulting impact beyond the leak.
Engineers running Linux kernels with the RDMA/mlx5 handler should check their versions; affected versions are not specified.