cdx: Fix double free when sysfs file creation fails
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:
cdx: Fix double free when sysfs file creation fails
In cdx_create_res_attr(), if sysfs_create_bin_file() fails, the code frees res_attr but doesn't set cdx_dev->res_attr[num] to NULL. This leaves a dangling pointer in the array. Then cdx_destroy_res_attr() frees the already-freed memory. Fix the double free by initializing cdx_dev->res_attr[num] after sysfs_create_bin_file() completes.
From the CVE record · Linux
The Linux kernel's cdx resource-attribute handling can leave a dangling pointer when sysfs file creation fails, causing a double free during cleanup. The input does not establish how an attacker could trigger this condition or whether access, authentication, or user interaction is required.
Anyone running a Linux kernel with the affected cdx code should check their version; affected versions are not specified.