mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-07-08 18:13:59 +02:00
smb: client: fix potential UAF in cifs_stats_proc_show()
commit0865ffefeaupstream. 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> [ cifs_debug.c was moved from fs/cifs to fs/smb/client since38c8a9a520("smb: move client and server files to common directory fs/smb"). The cifs_ses_exiting() was introduced to cifs_debug.c sinceca545b7f08("smb: client: fix potential UAF in cifs_debug_files_proc_show()") which has been sent to upstream already. ] Signed-off-by: Jianqi Ren <jianqi.ren.cn@windriver.com> Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ce49569079
commit
bb65700858
@@ -613,6 +613,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
|
||||
list_for_each(tmp2, &server->smb_ses_list) {
|
||||
ses = list_entry(tmp2, struct cifs_ses,
|
||||
smb_ses_list);
|
||||
if (cifs_ses_exiting(ses))
|
||||
continue;
|
||||
list_for_each(tmp3, &ses->tcon_list) {
|
||||
tcon = list_entry(tmp3,
|
||||
struct cifs_tcon,
|
||||
|
||||
Reference in New Issue
Block a user