CVE-2026-45922: RDMA/mlx5: Fix memory leak in GET_DATA_DIRECT_SYSFS_PATH handler
In the Linux kernel, the following vulnerability has been resolved:
RDMA/mlx5: Fix memory leak in GETDATADIRECTSYSFSPATH handler
The UVERBSHANDLER(MLX5IBMETHODGETDATADIRECTSYSFSPATH) function allocates memory for the device path using kobjectgetpath(). 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.85-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.18.14-1 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.75 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.14 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.19.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.116-1Fixed in 7.2.15-1Fixed in 7.3.3-1 - Compensating control
Add a kfree() call to the error path in the UVERBS_HANDLER(MLX5_IB_METHOD_GET_DATA_DIRECT_SYSFS_PATH) function so the memory allocated by kobject_get_path() is freed when the device path exceeds the output buffer length and the function returns -ENOSPC.
Event History
Frequently Asked Questions
What conditions are required to trigger the memory leak?
A local attacker or user needs low-privilege access and must invoke the MLX5 RDMA GET_DATA_DIRECT_SYSFS_PATH handler in a way that makes the device-path length exceed the provided output-buffer length. The failure path returns -ENOSPC without freeing memory allocated for the path.
What is the practical impact?
Repeatedly triggering the affected error path can leak kernel memory and exhaust available memory, causing a denial of service. The supplied CVSS vector indicates no confidentiality or integrity impact.
Is this remotely exploitable?
The provided CVSS vector lists attack vector as local and requires low privileges. No remote attack path is described.
What change fixes the issue?
The fix adds a kfree() call on the -ENOSPC error path so that the device-path memory allocated by kobject_get_path() is released. Stable kernel references are provided for the corresponding fixes.