Skip to content

Commit 705c76f

Browse files
Paulo Alcantarasmfrench
authored andcommitted
smb: client: fix potential UAF in smb2_is_valid_lease_break()
Skip sessions that are being teared down (status == SES_EXITING) to avoid UAF. Cc: [email protected] Signed-off-by: Paulo Alcantara (Red Hat) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 0865ffe commit 705c76f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/smb/client/smb2misc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,8 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
622622
/* look up tcon based on tid & uid */
623623
spin_lock(&cifs_tcp_ses_lock);
624624
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
625+
if (cifs_ses_exiting(ses))
626+
continue;
625627
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
626628
spin_lock(&tcon->open_file_lock);
627629
cifs_stats_inc(

0 commit comments

Comments
 (0)