Skip to content

Commit

Permalink
smb: client: fix deadlock in smb2_find_smb_tcon()
Browse files Browse the repository at this point in the history
[ Upstream commit 02c4187 ]

Unlock cifs_tcp_ses_lock before calling cifs_put_smb_ses() to avoid such
deadlock.

Cc: stable@vger.kernel.org
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ematsumiya authored and gregkh committed Jul 5, 2024
1 parent 78ebec4 commit b055752
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/smb2transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ smb2_find_smb_tcon(struct TCP_Server_Info *server, __u64 ses_id, __u32 tid)
}
tcon = smb2_find_smb_sess_tcon_unlocked(ses, tid);
if (!tcon) {
cifs_put_smb_ses(ses);
spin_unlock(&cifs_tcp_ses_lock);
cifs_put_smb_ses(ses);
return NULL;
}
spin_unlock(&cifs_tcp_ses_lock);
Expand Down

0 comments on commit b055752

Please sign in to comment.