]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/6.6.26/smb-client-fix-potential-uaf-in-cifs_stats_proc_show.patch
Linux 6.6.26
[thirdparty/kernel/stable-queue.git] / releases / 6.6.26 / smb-client-fix-potential-uaf-in-cifs_stats_proc_show.patch
CommitLineData
98979065
GKH
1From 0865ffefea197b437ba78b5dd8d8e256253efd65 Mon Sep 17 00:00:00 2001
2From: Paulo Alcantara <pc@manguebit.com>
3Date: Tue, 2 Apr 2024 16:33:56 -0300
4Subject: smb: client: fix potential UAF in cifs_stats_proc_show()
5
6From: Paulo Alcantara <pc@manguebit.com>
7
8commit 0865ffefea197b437ba78b5dd8d8e256253efd65 upstream.
9
10Skip sessions that are being teared down (status == SES_EXITING) to
11avoid UAF.
12
13Cc: stable@vger.kernel.org
14Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
15Signed-off-by: Steve French <stfrench@microsoft.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 fs/smb/client/cifs_debug.c | 2 ++
19 1 file changed, 2 insertions(+)
20
21--- a/fs/smb/client/cifs_debug.c
22+++ b/fs/smb/client/cifs_debug.c
23@@ -736,6 +736,8 @@ static int cifs_stats_proc_show(struct s
24 }
25 #endif /* STATS2 */
26 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
27+ if (cifs_ses_exiting(ses))
28+ continue;
29 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
30 i++;
31 seq_printf(m, "\n%d) %s", i, tcon->tree_name);