CVE-2026-142947: cxl/core: Skip einj_inject creation when devm_add_action_or_reset() fails
In the Linux kernel, the following vulnerability has been resolved:
cxl/core: Skip einjinject creation when devmaddactionorreset() fails
cxldebugfscreatedportdir() ignores the devmaddactionorreset() result and creates the einjinject file below @dir unconditionally.
When the devres allocation fails, removedebugfs() has already run before devmaddactionorreset() returns, i.e. debugfsremove() has released @dir. The subsequent debugfscreatefile() would then use that dentry as its parent although its final reference was dropped in the removal and its memory is subject to callrcu() delayed freeing.
Skip the file creation in that case, consistent with how the rest of the helper tolerates debugfs failures.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Compensating control
In cxl_debugfs_create_dport_dir(), skip creating the einj_inject debugfs file when devm_add_action_or_reset() fails, because remove_debugfs() may already have released @dir.
Event History
Frequently Asked Questions
What systems are exposed to this issue?
Systems running the Linux kernel with CXL core support are exposed when the affected debugfs path for CXL dports is exercised. The issue involves creation of the einj_inject debugfs file.
What conditions are required to trigger the flaw?
A devres allocation must fail during devm_add_action_or_reset() in cxl_debugfs_create_dport_dir(). The helper then removes the debugfs directory, but the vulnerable behavior attempts to create einj_inject using that removed directory dentry.
Is there a workaround if the fix cannot be applied immediately?
The provided information identifies the affected functionality as CXL debugfs file creation, but does not provide a documented configuration workaround. Applying a kernel version containing the referenced stable fixes is the indicated remediation.