Commit 3575455
ksmbd: lock the binding preauth session in smb3_preauth_hash_rsp
smb3_preauth_hash_rsp() computes the SMB3.1.1 preauth integrity hash on
the response path. For a binding SESSION_SETUP it looks up the
per-connection preauth_session and reads its Preauth_HashValue.
smb2_sess_setup() frees that preauth_session under ksmbd_conn_lock().
Two SMB2 requests on one connection can run concurrently, so an unlocked
lookup and hash can use a preauth_session after another worker frees it.
Take ksmbd_conn_lock() before selecting conn->binding and hold it across
the selected preauth hash lookup and update. This preserves the existing
hash selection while preventing the lookup-to-use lifetime race.
Fixes: 1c5daa2 ("ksmbd: handle channel binding with a different user")
Signed-off-by: Gil Portnoy <dddhkts1@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>1 parent b106657 commit 3575455
1 file changed
Lines changed: 9 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9808 | 9808 | | |
9809 | 9809 | | |
9810 | 9810 | | |
9811 | | - | |
| 9811 | + | |
9812 | 9812 | | |
9813 | 9813 | | |
9814 | 9814 | | |
9815 | 9815 | | |
9816 | 9816 | | |
9817 | | - | |
9818 | | - | |
9819 | | - | |
9820 | | - | |
9821 | | - | |
9822 | | - | |
9823 | | - | |
| 9817 | + | |
| 9818 | + | |
| 9819 | + | |
| 9820 | + | |
| 9821 | + | |
| 9822 | + | |
| 9823 | + | |
9824 | 9824 | | |
9825 | | - | |
9826 | | - | |
| 9825 | + | |
9827 | 9826 | | |
9828 | 9827 | | |
9829 | 9828 | | |
| |||
0 commit comments