Skip to content

Commit 0865ffe

Browse files
Paulo AlcantaraSteve French
authored andcommitted
smb: client: fix potential UAF in cifs_stats_proc_show()
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 d3da25c commit 0865ffe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/smb/client/cifs_debug.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
759759
}
760760
#endif /* STATS2 */
761761
list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
762+
if (cifs_ses_exiting(ses))
763+
continue;
762764
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
763765
i++;
764766
seq_printf(m, "\n%d) %s", i, tcon->tree_name);

0 commit comments

Comments
 (0)