fault-inject: fix dentry leak
Summary
| CVE | CVE-2026-138893 |
| State | PUBLISHED |
| Assigner | Linux |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-11-30 14:17:47 UTC |
| Updated | 2026-11-30 14:17:47 UTC |
| Description | In the Linux kernel, the following vulnerability has been resolved:
fault-inject: fix dentry leak
fault_create_debugfs_attr() has always taken an extra dentry reference on
the created directory (attr->dname = dget(dir)) so that fail_dump() could
print the name via %pd from any context. Nothing anywhere in the tree
ever calls dput() on attr->dname.
For callers with a matching teardown, that unmatched reference causes one
dentry plus its attached inode to leak per fault_create_debugfs_attr /
debugfs_remove_recursive cycle. simple_recursive_removal() drops
debugfs's own +1 ref on the child dentry, but the dget()'d ref keeps its
refcount at 1: the dentry ends up unhashed but pinned, and its inode is
never freed.
Boot-once callers (mm/failslab, block/blk-core, etc.) leak exactly once at
init and never destroy the tree, so the impact there is bounded. But
per-lifecycle callers (drivers/nvme, drivers/infiniband/hw/hfi1,
drivers/mmc, drivers/iommu/iommufd, drivers/media, drivers/misc,
drivers/gpu/drm/msm, drivers/crypto, net/sunrpc) leak on every
create/destroy cycle.
We observed this in production: an NVMe/RDMA host repeatedly reconnecting
to a target that rejected the CRTO Property Get went through ~50 nvme
controller create/destroy cycles per second, and dentry and inode_cache
grew by ~13k pinned objects per 240 s -- unrecoverable through
drop_caches. Byte math matched a per-cycle 1-dentry / 1-inode leak from
the "fault_inject" directory dentry.
Fix this by not holding any external reference in fault_attr. Embed the
directory name as a fixed-size char array (FAULT_ATTR_DNAME_LEN, 64 bytes)
inside struct fault_attr, copied by strscpy() at
fault_create_debugfs_attr() time. fail_dump() prints it via %s.
Advantages of an embedded array over kstrdup() + kfree() paired with a new
destroy API:
- Zero API footprint. No new export and no caller changes required:
callers already own their fault_attr's memory and free it when
they are done, and now that suffices.
- No allocation on the create path.
- fault_create_debugfs_attr() cannot fail from the name-copy step.
- No lifetime coupling between attr->dname and debugfs; the string
is valid for exactly as long as the containing struct.
The 64-byte length accommodates every in-tree caller with generous
headroom (the longest current name is "fail_dma_array_full", 19 chars).
The user-visible fail_dump() format changes from "name %pd" to "name %s",
but the printed content is identical -- %pd on the created directory
renders the same string that was passed in as @name.
drivers/infiniband/hw/hfi1/fault.c drops a now-invalid "attr.dname = NULL"
statement; the surrounding kzalloc() already zero-initialises the array. |
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|
| CNA |
Linux |
Linux |
affected 6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a aaac7d8fdae26d0753b6ee53f241d29380d22585 git |
Not specified |
| CNA |
Linux |
Linux |
affected 6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a 060ac88055da7a9e4047acb1f1b68e2e7a803605 git |
Not specified |
| CNA |
Linux |
Linux |
affected 6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a 0b1a8554cde4f90e0399da4016d8907dc7b72e79 git |
Not specified |
| CNA |
Linux |
Linux |
affected 6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a da4ad8207646ddc36e4e4f07cb672925c5675c1b git |
Not specified |
| CNA |
Linux |
Linux |
affected 6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a e172a797d4cfeabed1068437720dc54174c7ac33 git |
Not specified |
| CNA |
Linux |
Linux |
affected 6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a de69081c154e85db8f80ff260344881636e969a8 git |
Not specified |
| CNA |
Linux |
Linux |
affected 6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a 0237ca9810cf9b999c9b787726e62d3bdf634f24 git |
Not specified |
| CNA |
Linux |
Linux |
affected 6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a ceb43516a9aae0d969a4ec5ab40d45bd09e64229 git |
Not specified |
| CNA |
Linux |
Linux |
affected 3.19 |
Not specified |
| CNA |
Linux |
Linux |
unaffected 3.19 semver |
Not specified |
| CNA |
Linux |
Linux |
unaffected 5.10.275 5.10.* semver |
Not specified |
| CNA |
Linux |
Linux |
unaffected 5.15.226 5.15.* semver |
Not specified |
| CNA |
Linux |
Linux |
unaffected 6.1.193 6.1.* semver |
Not specified |
| CNA |
Linux |
Linux |
unaffected 6.6.163 6.6.* semver |
Not specified |
| CNA |
Linux |
Linux |
unaffected 6.12.117 6.12.* semver |
Not specified |
| CNA |
Linux |
Linux |
unaffected 6.18.63 6.18.* semver |
Not specified |
| CNA |
Linux |
Linux |
unaffected 7.3.4 7.3.* semver |
Not specified |
| CNA |
Linux |
Linux |
unaffected 7.4-rc1 * original_commit_for_fix |
Not specified |
References
| Reference | Source | Link | Tags |
|---|
| git.kernel.org/stable/c/de69081c154e85db8f80ff260344881636e969a8 |
416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
git.kernel.org |
|
| git.kernel.org/stable/c/0b1a8554cde4f90e0399da4016d8907dc7b72e79 |
416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
git.kernel.org |
|
| git.kernel.org/stable/c/aaac7d8fdae26d0753b6ee53f241d29380d22585 |
416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
git.kernel.org |
|
| git.kernel.org/stable/c/da4ad8207646ddc36e4e4f07cb672925c5675c1b |
416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
git.kernel.org |
|
| git.kernel.org/stable/c/e172a797d4cfeabed1068437720dc54174c7ac33 |
416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
git.kernel.org |
|
| git.kernel.org/stable/c/060ac88055da7a9e4047acb1f1b68e2e7a803605 |
416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
git.kernel.org |
|
| git.kernel.org/stable/c/ceb43516a9aae0d969a4ec5ab40d45bd09e64229 |
416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
git.kernel.org |
|
| git.kernel.org/stable/c/0237ca9810cf9b999c9b787726e62d3bdf634f24 |
416baaa9-dc9f-4396-8d5f-8c081fb06d67 |
git.kernel.org |
|
| CVE Program record |
CVE.ORG |
www.cve.org |
canonical |
| NVD vulnerability detail |
NVD |
nvd.nist.gov |
canonical, analysis |
No vendor comments have been submitted for this CVE.
There are currently no legacy QID mappings associated with this CVE.