ksmbd: fix session reference leak on compounded SESSION_SETUP
- CVE-2026-99539
- GHSA-42jx-q75f-j6j5
- EUVD-2026-130263
Description
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix session reference leak on compounded SESSION_SETUP A compound request can place SESSION_SETUP after another command. That earlier command leaves a reference to its session in work->sess. smb2_sess_setup() 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): __kmalloc_cache_noprof+0x32c/0x3a0 ksmbd_smb2_session_create+0xf6/0x9c0 [ksmbd] smb2_sess_setup+0xda4/0x6280 [ksmbd] handle_ksmbd_work+0x88c/0x1cb0 [ksmbd] Save the inherited session on entry. After the request has been processed, release it once, but only when smb2_sess_setup() has replaced work->sess with its own session or cleared it. Do this after ksmbd_conn_unlock() so the put does not run under srv_mutex. 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.
Text from the CVE.org record.
Recommendation
Linux
- If you run 6.6.xupdate to 6.6.163 or laterPatch update: breaking changes are unlikely
- If you run 6.1.xupdate to 6.1.193 or laterPatch update: breaking changes are unlikely
- If you run 5.15.xupdate to 5.15.226 or laterPatch update: breaking changes are unlikely
Some affected versions have no stated fix.
Taken from the version ranges of the CVE.org record. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
Linux
Affected versions Fixed in from 6.6.58 to before 6.6.163 6.6.163 from 6.1.114 to before 6.1.193 6.1.193 from 5.15.171 to before 5.15.226 5.15.226 from 6.11.5 to before 6.12 none stated 6.12 none stated before 6.12: not affected none stated from 5.15.226 up to 5.15.*: not affected none stated from 6.1.193 up to 6.1.*: not affected none stated and 5 more
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.