CVE-2026-99540: ksmbd: fix parent dentry lifetime in directory enumeration

Published Nov 19, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

ksmbd: fix parent dentry lifetime in directory enumeration

ksmbdpopulatedotdotdotentries() builds the ".." entry from the open directory's dparent and passes that pointer to ksmbdvfsfilldentryattrs() 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 dinode cleared, and after the RCU grace period the dentry itself is freed. The worker still holds the raw pointer and dereferences dinode through vfsgetattr() and vfsgetxattr().

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 handleksmbdwork RIP: 0010:xattrpermission+0x9d/0x160 Call Trace: vfsgetxattr+0x9c/0x1b0 ksmbdvfsgetxattr+0x82/0x100 ksmbdvfsgetdosattribxattr+0x7f/0x130 ksmbdvfsfilldentryattrs+0x435/0x650 ksmbdpopulatedotdotdotentries+0x25e/0x630 smb2querydir+0xcf9/0x1a20 handleksmbdwork+0x5f1/0x1c80 processonework+0x90b/0x19d0

Fix by using the dentry reference counting APIs: take the parent with dgetparent(), take a matching dget() on ".", and dput() the dentry once ksmbdvfsfilldentryattrs() has returned or the pattern does not match.

Affected Software

3 affected componentsFixes available
linux/kernel>=5.15.0<6.12.117
6.12.117
linux/kernel>=6.13.0<6.18.61
6.18.61
linux/kernel>=6.19.0<7.3.2
7.3.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.117
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.61
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.2

Event History

Nov 19, 2026
CVE Published
via MITRE·02:44 PM
Data Sourced
via MITRE·02:44 PM
Description
Data Sourced
via OSV·02:44 PM
DescriptionAffected Software
Data Sourced
via NVD·03:18 PM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203