CVE-2026-99386: smb: client: don't resurrect an exiting tcon from cached dir workers
In the Linux kernel, the following vulnerability has been resolved:
smb: client: don't resurrect an exiting tcon from cached dir workers
cfidslaundromatworker() bumps tcon->tccount for every expired open cfid and queues cacheddiroffloadclose() without checking whether the tcon is already being torn down. Racing with the final cifsputtcon(), the tcon comes back from zero and gets torn down twice:
T1 T2 cifsputtcon() --tccount == 0, TIDEXITING tconInfoFree() freecacheddirs() canceldelayedworksync() cfidslaundromatworker() ++tccount == 1 queuework(serverclosewq) kfree(tcon->originfullpath) kfree(tcon) cacheddiroffloadclose() closecacheddir() [UAF] cifsputtcon() tconInfoFree() [double free]
cacheddirleasebreak() also bumps tccount without tclock, racing with the laundromat's locked update.
Take the tcon reference through a helper that refuses once the tcon is TIDEXITING or its refcount has dropped to zero. Queued putwork and closework then always hold a tcon reference, so tconInfoFree() can't run before they finish and freecacheddirs() doesn't need to flush any workqueue. If the laundromat can't get a reference, put the cfid back on the dying list for freecacheddirs() to free; its handle goes away with the tree connection.
The lease break path finds the tcon on ses->tconlist under cifstcpseslock, so it can't see TIDEXITING, but it now takes tclock.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- 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