[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250811094639.37446-3-chanho.min@lge.com>
Date: Mon, 11 Aug 2025 18:46:37 +0900
From: Chanho Min <chanho.min@....com>
To: Steve French <sfrench@...ba.org>,
linux-cifs@...r.kernel.org
Cc: samba-technical@...ts.samba.org,
linux-kernel@...r.kernel.org,
gunho.lee@....com,
gregkh@...uxfoundation.org,
sashal@...nel.org,
Paulo Alcantara <pc@...guebit.com>,
stable@...r.kernel.org,
Steve French <stfrench@...rosoft.com>,
Chanho Min <chanho.min@....com>
Subject: [PATCH 2/4] smb: client: fix potential UAF in is_valid_oplock_break()
From: Paulo Alcantara <pc@...guebit.com>
commit 69ccf040acddf33a3a85ec0f6b45ef84b0f7ec29 upstream.
Skip sessions that are being teared down (status == SES_EXITING) to
avoid UAF.
Cc: stable@...r.kernel.org # 5.4
Signed-off-by: Paulo Alcantara (Red Hat) <pc@...guebit.com>
Signed-off-by: Steve French <stfrench@...rosoft.com>
[ chanho: Backported to v5.4.y, misc.c was moved from fs/cifs to fs/smb/client ]
Signed-off-by: Chanho Min <chanho.min@....com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/cifs/misc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index db1fcdedf289a..4d838d7db7b57 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -473,6 +473,8 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
spin_lock(&cifs_tcp_ses_lock);
list_for_each(tmp, &srv->smb_ses_list) {
ses = list_entry(tmp, struct cifs_ses, smb_ses_list);
+ if (cifs_ses_exiting(ses))
+ continue;
list_for_each(tmp1, &ses->tcon_list) {
tcon = list_entry(tmp1, struct cifs_tcon, tcon_list);
if (tcon->tid != buf->Tid)
Powered by blists - more mailing lists