smb: client: fix use-after-free in cifs_ses_add_channel()

State
Published
Severity
Not Scored
Published
Nov 19, 2026
Updated
Nov 23, 2026
Reserved
Sep 25, 2026

Read the record on cve.org

Description

In the Linux kernel, the following vulnerability has been resolved:

smb: client: fix use-after-free in cifs_ses_add_channel()

The error path of cifs_ses_add_channel() calls cifs_put_tcp_session() before cifs_chan_clear_need_reconnect(). The latter reaches cifs_ses_get_chan_index(), which dereferences server->terminate; if the put was the final reference, TCP_Server_Info 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 cifs_chan_skip_or_disable()").

Move the put last, but do not read chan->server after dropping chan_lock: chan points into ses->chans[], and once chan_count is decremented a concurrent add_channel can reuse the slot and overwrite the pointer, so the put would act on the new channel's server. Cache the pointer under chan_lock, clear the reconnect bit and decrement chan_count while still holding the reference, and release it after the unlock.

This issue was discovered by Tencent CodeBuddy Security.

ProductVersions
Linux Linuxe341b7975bd72d3ebda92b8d747d0aad15ce8717 to before 093a42a31ae8bb26da7f4a358f83300d76d0c46b Affected3e1615361b6fa6e6e0bfae0efb3a8c2255ac101f to before 4bc20a4ccdbdbe14e8628073109c52a22d7512d1 Affectedee1d21794e55ab76505745d24101331552182002 to before d88e3e844fad0f6b9fbeb8c8862f9272a7c26a99 Affectedee1d21794e55ab76505745d24101331552182002 to before 8069935474b1502459ab50f75a67d7394a93cd5d Affectedee1d21794e55ab76505745d24101331552182002 to before 72367dacb5c9d8bd486b2fcaf56b6d3086d57250 Affectedee1d21794e55ab76505745d24101331552182002 to before 031278577380e7875d95aed81a2b2bcac39be923 Affected6.1.178 to before 6.1.193 Affected6.6.15 to before 6.6.163 Affected
Linux Linux6.7 Affectedbefore 6.7 Not Affected6.1.193 through 6.1.* Not Affected6.6.163 through 6.6.* Not Affected6.12.117 through 6.12.* Not Affected6.18.61 through 6.18.* Not Affected7.3.2 through 7.3.* Not Affected7.4-rc1 and later Not Affected

Weaknesses

The record names no weakness.

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.