Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

smb: client: fix potential UAF in cifs_stats_proc_show()

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>

authored by

Paulo Alcantara and committed by
Steve French
0865ffef d3da25c5

+2
+2
fs/smb/client/cifs_debug.c
··· 759 759 } 760 760 #endif /* STATS2 */ 761 761 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { 762 + if (cifs_ses_exiting(ses)) 763 + continue; 762 764 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { 763 765 i++; 764 766 seq_printf(m, "\n%d) %s", i, tcon->tree_name);