CVE-2026-99540
published high CVSS 3.1 · 8.8ksmbd: fix parent dentry lifetime in directory enumeration
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxe2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < cdc9a843b4688fa2729ddaf3e575dadd243aacc1 · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < e8af427da35cf10c9d26b96d91b6849dd01e125c · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 32934b13b1a63c86d2fa68df0bfb28c51ce38879 · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 93566781118cdff874023d5ca4e7b8054baaec31 · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < b62ef8cfec9351662e42cbf7da2d743068699bba · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 171df27077fb49b4af2c53ad2cedcd0e39664fe8 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.15 (affected) · 0 to < 5.15 (unaffected · semver) · 6.1.193 through 6.1.* (unaffected · semver) · 6.6.163 through 6.6.* (unaffected · semver) · 6.12.117 through 6.12.* (unaffected · semver) · 6.18.61 through 6.18.* (unaffected · semver) · 7.3.2 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Debian | bookworm | linux-6.12 | Advisory build | 6.12.117-1~deb12u1 | DLA-4927-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-develaarch64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-develppc64le | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-devels390x | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
Show 13 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-develx86_64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-macrosaarch64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-macrosppc64le | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-macross390x | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-macrosx86_64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-sourceaarch64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-sourceppc64le | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-sources390x | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-sourcex86_64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-source-vanillaaarch64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-source-vanillappc64le | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-source-vanillas390x | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-source-vanillax86_64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
Description
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix parent dentry lifetime in directory enumeration ksmbd_populate_dot_dotdot_entries() builds the ".." entry from the open directory's d_parent and passes that pointer to ksmbd_vfs_fill_dentry_attrs() without taking a reference. That pointer is only valid while the directory stays under this parent. If a concurrent rename moves the directory elsewhere, the old parent loses its last reference; a following rmdir then turns it into a negative dentry with d_inode cleared, and after the RCU grace period the dentry itself is freed. The worker still holds the raw pointer and dereferences d_inode through vfs_getattr() and vfs_getxattr(). A remote SMB client, authenticated or guest, triggers this by listing a directory while that directory is moved under a new parent and the old parent is deleted. It can be done by the client itself with write access or by other concurrent writers, triggering null-ptr-deref and slab-use-after-free on a KASAN build. KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] Workqueue: ksmbd-io handle_ksmbd_work RIP: 0010:xattr_permission+0x9d/0x160 Call Trace: vfs_getxattr+0x9c/0x1b0 ksmbd_vfs_getxattr+0x82/0x100 ksmbd_vfs_get_dos_attrib_xattr+0x7f/0x130 ksmbd_vfs_fill_dentry_attrs+0x435/0x650 ksmbd_populate_dot_dotdot_entries+0x25e/0x630 smb2_query_dir+0xcf9/0x1a20 handle_ksmbd_work+0x5f1/0x1c80 process_one_work+0x90b/0x19d0 Fix by using the dentry reference counting APIs: take the parent with dget_parent(), take a matching dget() on ".", and dput() the dentry once ksmbd_vfs_fill_dentry_attrs() has returned or the pattern does not match.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 8.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:N - An SMB2 QUERY_DIRECTORY PDU on TCP/445 is dispatched by handle_ksmbd_work() to smb2_query_dir(), which calls ksmbd_populate_dot_dotdot_entries() and passes the open directory's d_parent to ksmbd_vfs_fill_dentry_attrs() without a reference. The same client drops that parent with SMB2 SET_INFO FILE_RENAME_INFORMATION (__d_move) and delete-on-close rmdir (ksmbd_vfs_unlink). AC:L - The client creates a one-child parent, opens the child, and races QUERY_DIRECTORY against its own rename and parent delete. Those run as separate ksmbd-io works (WQ_PERCPU, max_active default); readdir_lock is only the listing ksmbd_file's mutex, so the attacker holds both sides and can repeat the race. PR:L - smb2_check_user_session() accepts SMB2_QUERY_DIRECTORY only for an SMB2_SESSION_VALID session, and the freeing side needs a writable tree: smb2_set_info() returns -EACCES without KSMBD_TREE_CONN_FLAG_WRITABLE and set_rename_info() requires FILE_DELETE on the open directory. UI:N - The attacker creates the directories, sends QUERY_DIRECTORY with a pattern that matches "..", renames the open directory, and closes the old parent with delete pending, all on sessions they opened. S:U - The dangling parent is dereferenced in the ksmbd-io worker via vfs_getattr() and vfs_getxattr(). A crash or resulting code execution stays in the host kernel that serves the share. C:H - The worker keeps the raw parent pointer across dentry_unlink_inode() and the RCU free in dentry_free(). vfs_getattr_nosec() and vfs_getxattr() then load d_inode and follow i_sb, i_op, and xattr handlers, so a reused slab slot discloses kernel memory through that pointer. I:H - On the freed parent, vfs_getattr_nosec() calls inode->i_op->getattr and vfs_getxattr() calls the xattr handler->get. Reclaiming the dentry slab before those calls gives a use-after-free of those function pointers and a kernel write/code-execution primitive. A:H - rmdir turns the unreferenced parent negative and dentry_kill() clears d_inode, which NULL-derefs in xattr_permission() via ksmbd_vfs_get_dos_attrib_xattr(); after call_rcu() in dentry_free() the same vfs_getattr()/vfs_getxattr() path is a slab use-after-free. Either oopses ksmbd-io.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < cdc9a843b4688fa2729ddaf3e575dadd243aacc1 (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < e8af427da35cf10c9d26b96d91b6849dd01e125c (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 32934b13b1a63c86d2fa68df0bfb28c51ce38879 (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 93566781118cdff874023d5ca4e7b8054baaec31 (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < b62ef8cfec9351662e42cbf7da2d743068699bba (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 171df27077fb49b4af2c53ad2cedcd0e39664fe8 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.15 (affected)0 to < 5.15 (unaffected · semver)6.1.193 through 6.1.* (unaffected · semver)6.6.163 through 6.6.* (unaffected · semver)6.12.117 through 6.12.* (unaffected · semver)6.18.61 through 6.18.* (unaffected · semver)7.3.2 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
6- https://git.kernel.org/stable/c/171df27077fb49b4af2c53ad2cedcd0e39664fe8
- https://git.kernel.org/stable/c/32934b13b1a63c86d2fa68df0bfb28c51ce38879
- https://git.kernel.org/stable/c/93566781118cdff874023d5ca4e7b8054baaec31
- https://git.kernel.org/stable/c/b62ef8cfec9351662e42cbf7da2d743068699bba
- https://git.kernel.org/stable/c/cdc9a843b4688fa2729ddaf3e575dadd243aacc1
- https://git.kernel.org/stable/c/e8af427da35cf10c9d26b96d91b6849dd01e125c
Provider assertions
1Linux · cna
ksmbd: fix parent dentry lifetime in directory enumeration
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 4da414e1fa46cf552519fed2b538346aaed931ddcf7ea66eb9da5eaaa7178cbd
- Ingested
- 23 Nov 2026, 14:35:29 UTC
- Source record
- Official CVE record