CVE-2026-93215: cdx: Fix double free when sysfs file creation fails
In the Linux kernel, the following vulnerability has been resolved:
cdx: Fix double free when sysfs file creation fails
In cdxcreateresattr(), if sysfscreatebinfile() fails, the code frees resattr but doesn't set cdxdev->resattr[num] to NULL. This leaves a dangling pointer in the array. Then cdxdestroyresattr() frees the already-freed memory. Fix the double free by initializing cdxdev->resattr[num] after sysfscreatebinfile() completes.
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.1.176-1Fixed in 6.1.190-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1 - Upgrade
Upgrade
debian/linux-6.12to a version that resolves this vulnerability.Fixed in 6.12.113-1~deb12u1 - Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1 - Compensating control
In cdx_create_res_attr(), initialize cdx_dev->res_attr[num] to NULL after sysfs_create_bin_file() completes, including when the call fails and res_attr is freed, to prevent cdx_destroy_res_attr() from freeing the already-freed memory.
Event History
Frequently Asked Questions
What conditions are required to trigger the double free?
The failure path requires sysfs_create_bin_file() to fail during cdx_create_res_attr(). The failed allocation path leaves a dangling pointer in cdx_dev->res_attr[num], which is later freed again by cdx_destroy_res_attr().
How can systems be remediated?
Apply a kernel version containing the fix that initializes cdx_dev->res_attr[num] only after sysfs_create_bin_file() completes successfully. The provided stable kernel references identify commits containing the correction.