mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
smb: client: protect tc_count increment in smb2_find_smb_sess_tcon_unlocked()
Commit96c4af4185("cifs: Fix locking usage for tcon fields") refactored cifs code to change cifs_tcp_ses_lock for tc_lock around tc_count changes. There was missing lock around tc_count increment inside smb2_find_smb_sess_tcon_unlocked(). Cc: stable@vger.kernel.org Fixes:96c4af4185("cifs: Fix locking usage for tcon fields") Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
5200f5f493
commit
4d8690dace
|
|
@ -169,7 +169,9 @@ smb2_find_smb_sess_tcon_unlocked(struct cifs_ses *ses, __u32 tid)
|
|||
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
|
||||
if (tcon->tid != tid)
|
||||
continue;
|
||||
spin_lock(&tcon->tc_lock);
|
||||
++tcon->tc_count;
|
||||
spin_unlock(&tcon->tc_lock);
|
||||
trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count,
|
||||
netfs_trace_tcon_ref_get_find_sess_tcon);
|
||||
return tcon;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user