CVE-2026-99539: ksmbd: fix session reference leak on compounded SESSION_SETUP
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix session reference leak on compounded SESSIONSETUP
A compound request can place SESSIONSETUP after another command. That earlier command leaves a reference to its session in work->sess. smb2sesssetup() then overwrites work->sess with the session it looks up or creates, and the dispatcher later puts work->sess only once. The inherited reference is never dropped. That leaks the session, together with its setup connection and socket, and every repeat of the compound leaks another.
unreferenced object (size 512): kmalloccachenoprof+0x32c/0x3a0 ksmbdsmb2sessioncreate+0xf6/0x9c0 [ksmbd] smb2sesssetup+0xda4/0x6280 [ksmbd] handleksmbdwork+0x88c/0x1cb0 [ksmbd]
Save the inherited session on entry. After the request has been processed, release it once, but only when smb2sesssetup() has replaced work->sess with its own session or cleared it. Do this after ksmbdconnunlock() so the put does not run under srvmutex. An error path may instead leave the inherited session in work->sess. Keep it there, so the dispatcher still puts it and the error response is still signed or encrypted with it as before.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.16 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.2 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.7 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.3-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1Fixed in 7.3.4-1Fixed in 7.3.5-1