Skip to content

Commit 6398156

Browse files
Paulo Alcantarasmfrench
authored andcommitted
smb: client: fix potential UAF in smb2_is_network_name_deleted()
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 69ccf04 commit 6398156

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/smb/client/smb2ops.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,6 +2481,8 @@ smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server)
24812481

24822482
spin_lock(&cifs_tcp_ses_lock);
24832483
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
2484+
if (cifs_ses_exiting(ses))
2485+
continue;
24842486
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
24852487
if (tcon->tid == le32_to_cpu(shdr->Id.SyncId.TreeId)) {
24862488
spin_lock(&tcon->tc_lock);

0 commit comments

Comments
 (0)