]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-6.1/smb-client-fix-potential-uaf-in-cifs_signal_cifsd_for_reconnect.patch
6.8-stable patches
[thirdparty/kernel/stable-queue.git] / queue-6.1 / smb-client-fix-potential-uaf-in-cifs_signal_cifsd_for_reconnect.patch
CommitLineData
21f7ce28
GKH
1From e0e50401cc3921c9eaf1b0e667db174519ea939f Mon Sep 17 00:00:00 2001
2From: Paulo Alcantara <pc@manguebit.com>
3Date: Tue, 2 Apr 2024 16:34:04 -0300
4Subject: smb: client: fix potential UAF in cifs_signal_cifsd_for_reconnect()
5
6From: Paulo Alcantara <pc@manguebit.com>
7
8commit e0e50401cc3921c9eaf1b0e667db174519ea939f 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/connect.c | 2 ++
19 1 file changed, 2 insertions(+)
20
21--- a/fs/smb/client/connect.c
22+++ b/fs/smb/client/connect.c
23@@ -216,6 +216,8 @@ cifs_signal_cifsd_for_reconnect(struct T
24
25 spin_lock(&cifs_tcp_ses_lock);
26 list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
27+ if (cifs_ses_exiting(ses))
28+ continue;
29 spin_lock(&ses->chan_lock);
30 for (i = 0; i < ses->chan_count; i++) {
31 spin_lock(&ses->chans[i].server->srv_lock);