{"id":"CVE-2026-138893","aliases":["CVE-2026-138893"],"related":[],"kind":"vulnerability","state":"published","title":"fault-inject: fix dentry leak","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nfault-inject: fix dentry leak\n\nfault_create_debugfs_attr() has always taken an extra dentry reference on\nthe created directory (attr->dname = dget(dir)) so that fail_dump() could\nprint the name via %pd from any context.  Nothing anywhere in the tree\never calls dput() on attr->dname.\n\nFor callers with a matching teardown, that unmatched reference causes one\ndentry plus its attached inode to leak per fault_create_debugfs_attr /\ndebugfs_remove_recursive cycle.  simple_recursive_removal() drops\ndebugfs's own +1 ref on the child dentry, but the dget()'d ref keeps its\nrefcount at 1: the dentry ends up unhashed but pinned, and its inode is\nnever freed.\n\nBoot-once callers (mm/failslab, block/blk-core, etc.) leak exactly once at\ninit and never destroy the tree, so the impact there is bounded.  But\nper-lifecycle callers (drivers/nvme, drivers/infiniband/hw/hfi1,\ndrivers/mmc, drivers/iommu/iommufd, drivers/media, drivers/misc,\ndrivers/gpu/drm/msm, drivers/crypto, net/sunrpc) leak on every\ncreate/destroy cycle.\n\nWe observed this in production: an NVMe/RDMA host repeatedly reconnecting\nto a target that rejected the CRTO Property Get went through ~50 nvme\ncontroller create/destroy cycles per second, and dentry and inode_cache\ngrew by ~13k pinned objects per 240 s -- unrecoverable through\ndrop_caches.  Byte math matched a per-cycle 1-dentry / 1-inode leak from\nthe \"fault_inject\" directory dentry.\n\nFix this by not holding any external reference in fault_attr.  Embed the\ndirectory name as a fixed-size char array (FAULT_ATTR_DNAME_LEN, 64 bytes)\ninside struct fault_attr, copied by strscpy() at\nfault_create_debugfs_attr() time.  fail_dump() prints it via %s.\n\nAdvantages of an embedded array over kstrdup() + kfree() paired with a new\ndestroy API:\n\n  - Zero API footprint.  No new export and no caller changes required:\n    callers already own their fault_attr's memory and free it when\n    they are done, and now that suffices.\n  - No allocation on the create path.\n  - fault_create_debugfs_attr() cannot fail from the name-copy step.\n  - No lifetime coupling between attr->dname and debugfs; the string\n    is valid for exactly as long as the containing struct.\n\nThe 64-byte length accommodates every in-tree caller with generous\nheadroom (the longest current name is \"fail_dma_array_full\", 19 chars).\n\nThe user-visible fail_dump() format changes from \"name %pd\" to \"name %s\",\nbut the printed content is identical -- %pd on the created directory\nrenders the same string that was passed in as @name.\n\ndrivers/infiniband/hw/hfi1/fault.c drops a now-invalid \"attr.dname = NULL\"\nstatement; the surrounding kzalloc() already zero-initialises the array.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nfault-inject: fix dentry leak\n\nfault_create_debugfs_attr() has always taken an extra dentry reference on\nthe created directory (attr->dname = dget(dir)) so that fail_dump() could\nprint the name via %pd from any context.  Nothing anywhere in the tree\never calls dput() on attr->dname.\n\nFor callers with a matching teardown, that unmatched reference causes one\ndentry plus its attached inode to leak per fault_create_debugfs_attr /\ndebugfs_remove_recursive cycle.  simple_recursive_removal() drops\ndebugfs's own +1 ref on the child dentry, but the dget()'d ref keeps its\nrefcount at 1: the dentry ends up unhashed but pinned, and its inode is\nnever freed.\n\nBoot-once callers (mm/failslab, block/blk-core, etc.) leak exactly once at\ninit and never destroy the tree, so the impact there is bounded.  But\nper-lifecycle callers (drivers/nvme, drivers/infiniband/hw/hfi1,\ndrivers/mmc, drivers/iommu/iommufd, drivers/media, drivers/misc,\ndrivers/gpu/drm/msm, drivers/crypto, net/sunrpc) leak on every\ncreate/destroy cycle.\n\nWe observed this in production: an NVMe/RDMA host repeatedly reconnecting\nto a target that rejected the CRTO Property Get went through ~50 nvme\ncontroller create/destroy cycles per second, and dentry and inode_cache\ngrew by ~13k pinned objects per 240 s -- unrecoverable through\ndrop_caches.  Byte math matched a per-cycle 1-dentry / 1-inode leak from\nthe \"fault_inject\" directory dentry.\n\nFix this by not holding any external reference in fault_attr.  Embed the\ndirectory name as a fixed-size char array (FAULT_ATTR_DNAME_LEN, 64 bytes)\ninside struct fault_attr, copied by strscpy() at\nfault_create_debugfs_attr() time.  fail_dump() prints it via %s.\n\nAdvantages of an embedded array over kstrdup() + kfree() paired with a new\ndestroy API:\n\n  - Zero API footprint.  No new export and no caller changes required:\n    callers already own their fault_attr's memory and free it when\n    they are done, and now that suffices.\n  - No allocation on the create path.\n  - fault_create_debugfs_attr() cannot fail from the name-copy step.\n  - No lifetime coupling between attr->dname and debugfs; the string\n    is valid for exactly as long as the containing struct.\n\nThe 64-byte length accommodates every in-tree caller with generous\nheadroom (the longest current name is \"fail_dma_array_full\", 19 chars).\n\nThe user-visible fail_dump() format changes from \"name %pd\" to \"name %s\",\nbut the printed content is identical -- %pd on the created directory\nrenders the same string that was passed in as @name.\n\ndrivers/infiniband/hw/hfi1/fault.c drops a now-invalid \"attr.dname = NULL\"\nstatement; the surrounding kzalloc() already zero-initialises the array.","source":"cvelist"}],"published":"2026-11-30T13:25:58.141Z","modified":"2026-11-30T14:17:47.063Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a","fixed":"aaac7d8fdae26d0753b6ee53f241d29380d22585","status":"affected"},{"type":"git","introduced":"6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a","fixed":"060ac88055da7a9e4047acb1f1b68e2e7a803605","status":"affected"},{"type":"git","introduced":"6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a","fixed":"0b1a8554cde4f90e0399da4016d8907dc7b72e79","status":"affected"},{"type":"git","introduced":"6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a","fixed":"da4ad8207646ddc36e4e4f07cb672925c5675c1b","status":"affected"},{"type":"git","introduced":"6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a","fixed":"e172a797d4cfeabed1068437720dc54174c7ac33","status":"affected"},{"type":"git","introduced":"6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a","fixed":"de69081c154e85db8f80ff260344881636e969a8","status":"affected"},{"type":"git","introduced":"6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a","fixed":"0237ca9810cf9b999c9b787726e62d3bdf634f24","status":"affected"},{"type":"git","introduced":"6adc4a22f20bbf3bbc754f1ec8c82be5dfb5c71a","fixed":"ceb43516a9aae0d969a4ec5ab40d45bd09e64229","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.19","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.19","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/aaac7d8fdae26d0753b6ee53f241d29380d22585","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/060ac88055da7a9e4047acb1f1b68e2e7a803605","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0b1a8554cde4f90e0399da4016d8907dc7b72e79","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/da4ad8207646ddc36e4e4f07cb672925c5675c1b","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e172a797d4cfeabed1068437720dc54174c7ac33","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/de69081c154e85db8f80ff260344881636e969a8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0237ca9810cf9b999c9b787726e62d3bdf634f24","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ceb43516a9aae0d969a4ec5ab40d45bd09e64229","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138893","url":"https://www.cve.org/CVERecord?id=CVE-2026-138893","licence":"CVE Terms of Use","modified":"2026-11-30T13:25:58.141Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138893","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138893","licence":"Public domain","modified":"2026-11-30T14:17:47.063Z"}],"updatedAt":"2026-11-30T14:32:33.956Z","epss":{"score":0.0022,"percentile":0.13274,"date":"2026-12-01T12:00:22.000Z"}}