[lvc-project] [PATCH 5.10] smb: client: fix potential UAF in is_valid_oplock_break()
Viktoriya Danchenko
v.danchenko at omp.ru
Tue Mar 24 20:21:37 MSK 2026
From: Paulo Alcantara <pc at manguebit.com>
commit 69ccf040acddf33a3a85ec0f6b45ef84b0f7ec29 upstream.
Skip sessions that are being teared down (status == SES_EXITING) to
avoid UAF.
Cc: stable at vger.kernel.org
Signed-off-by: Paulo Alcantara (Red Hat) <pc at manguebit.com>
Signed-off-by: Steve French <stfrench at microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Signed-off-by: Karina Yankevich <k.yankevich at omp.ru>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Viktoriya Danchenko <v.danchenko at omp.ru>
---
Backport fix for CVE-2024-35863
---
fs/cifs/misc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 54c443686dab..cd652c623219 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -485,6 +485,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)
--
2.43.0
More information about the lvc-project
mailing list