CVE-2026-99525: smb: client: fix use-after-free in cifs_ses_add_channel()
In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix use-after-free in cifssesaddchannel()
The error path of cifssesaddchannel() calls cifsputtcpsession() before cifschanclearneedreconnect(). The latter reaches cifssesgetchanindex(), which dereferences server->terminate; if the put was the final reference, TCPServerInfo is already freed and this is a use-after-free. Same put-then-use pattern as the recently fixed sibling in commit 717e0a25036b ("cifs: Fix server use-after-free in cifschanskipordisable()").
Move the put last, but do not read chan->server after dropping chanlock: chan points into ses->chans[], and once chancount is decremented a concurrent addchannel can reuse the slot and overwrite the pointer, so the put would act on the new channel's server. Cache the pointer under chanlock, clear the reconnect bit and decrement chancount while still holding the reference, and release it after the unlock.
This issue was discovered by Tencent CodeBuddy Security.
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.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.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