Skip to content

Commit e0e5040

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

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/smb/client/connect.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ cifs_signal_cifsd_for_reconnect(struct TCP_Server_Info *server,
175175

176176
spin_lock(&cifs_tcp_ses_lock);
177177
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
178+
if (cifs_ses_exiting(ses))
179+
continue;
178180
spin_lock(&ses->chan_lock);
179181
for (i = 0; i < ses->chan_count; i++) {
180182
if (!ses->chans[i].server)

0 commit comments

Comments
 (0)