diff options
| author | Nicholas Carlini <nicholas@carlini.com> | 2026-03-09 08:29:49 +0900 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2026-03-17 21:45:29 -0500 |
| commit | 5258572aa5fd5a7ed01b123b28241e0281b6fb9b (patch) | |
| tree | 0544e60318d4d9f4d6b7e0e5be14921f3c6ff109 /scripts/rt-tester/git@git.tavy.me:linux.git | |
| parent | f338e77383789c0cae23ca3d48adcc5e9e137e3c (diff) | |
ksmbd: fix share_conf UAF in tree_conn disconnect
__ksmbd_tree_conn_disconnect() drops the share_conf reference before
checking tree_conn->refcount. When someone uses SMB3 multichannel and
binds two connections to one session, a SESSION_LOGOFF on connection A
calls ksmbd_conn_wait_idle(conn) which only drains connection A's
request counter, not connection B's. This means there's a race condition:
requests already dispatched on connection B hold tree_conn references via
work->tcon. The disconnect path frees share_conf while those requests
are still walking work->tcon->share_conf, causing a use-after-free.
This fix combines the share_conf put with the tree_conn free so it
only happens when the last reference is dropped.
Fixes: b39a1833cc4a ("ksmbd: fix use-after-free in ksmbd_tree_connect_put under concurrency")
Signed-off-by: Nicholas Carlini <nicholas@carlini.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'scripts/rt-tester/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
