Skip to content

Commit 2286348

Browse files
Paulo Alcantarasmfrench
authored andcommitted
smb: client: fix potential UAF in smb2_is_valid_oplock_break()
Skip sessions that are being teared down (status == SES_EXITING) to avoid UAF. Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 705c76f commit 2286348

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/smb/client/smb2misc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
699699
/* look up tcon based on tid & uid */
700700
spin_lock(&cifs_tcp_ses_lock);
701701
list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
702+
if (cifs_ses_exiting(ses))
703+
continue;
702704
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
703705

704706
spin_lock(&tcon->open_file_lock);

0 commit comments

Comments
 (0)