CVE-2026-143036: smb: client: skip NULL channel in __cifs_put_smb_ses()
In the Linux kernel, the following vulnerability has been resolved:
smb: client: skip NULL channel in cifsputsmbses()
cifschanskipordisable() clears a secondary channel's slot in the session (ses->chans[chanindex].server = NULL) without lowering chancount when the server stops supporting multichannel. When the session is later released, cifsputsmbses() walks every slot up to chancount and calls cifsputtcpsession() on it, which dereferences the server pointer immediately, so a slot left NULL by the skip path makes the release crash with a NULL pointer dereference.
Clearing a slot without lowering chancount is older than cifschanskipordisable(): cifschanupdateiface() could already do the same since commit b54034a73baf9 ("cifs: during reconnect, update interface if necessary"), and the release loop has been unguarded since then. Commit 12d1e301bdfd1 ("cifs: do not let cifschanupdateiface deallocate channels") later removed that trigger, but the crash is reachable through it on older kernels.
cifsdecreasesecondarychannels() already guards the same put with if (server). Add the same guard to the release loop so a skipped channel slot is left alone.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Add a NULL-server guard in the __cifs_put_smb_ses() release loop before calling cifs_put_tcp_session(), so skipped channel slots are not dereferenced.