]> Git Repo - linux.git/commitdiff
smb: client: fix potential UAF in smb2_is_network_name_deleted()
authorPaulo Alcantara <[email protected]>
Tue, 2 Apr 2024 19:34:02 +0000 (16:34 -0300)
committerSteve French <[email protected]>
Wed, 3 Apr 2024 19:45:06 +0000 (14:45 -0500)
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]>
fs/smb/client/smb2ops.c

index 87b63f6ad2e2e9e49cf8988891e8cb7745b7d8d7..b156eefa75d7cb4b13d1bf402234f08271a558ad 100644 (file)
@@ -2481,6 +2481,8 @@ smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server)
 
        spin_lock(&cifs_tcp_ses_lock);
        list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
+               if (cifs_ses_exiting(ses))
+                       continue;
                list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
                        if (tcon->tid == le32_to_cpu(shdr->Id.SyncId.TreeId)) {
                                spin_lock(&tcon->tc_lock);
This page took 0.06048 seconds and 4 git commands to generate.