Skip to content

Commit d3da25c

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

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
@@ -678,6 +678,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
678678
}
679679
#endif /* CONFIG_CIFS_STATS2 */
680680
list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
681+
if (cifs_ses_exiting(ses))
682+
continue;
681683
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
682684
atomic_set(&tcon->num_smbs_sent, 0);
683685
spin_lock(&tcon->stat_lock);

0 commit comments

Comments
 (0)