Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.com>
To: smfrench@gmail.com
Cc: linux-cifs@vger.kernel.org, Paulo Alcantara <pc@manguebit.com>
Subject: [PATCH 06/12] smb: client: fix potential UAF in smb2_is_valid_lease_break()
Date: Tue,  2 Apr 2024 16:33:58 -0300	[thread overview]
Message-ID: <20240402193404.236159-6-pc@manguebit.com> (raw)
In-Reply-To: <20240402193404.236159-1-pc@manguebit.com>

Skip sessions that are being teared down (status == SES_EXITING) to
avoid UAF.

Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
---
 fs/smb/client/smb2misc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/smb/client/smb2misc.c b/fs/smb/client/smb2misc.c
index 14d74ef70cc8..4abbf6545c9c 100644
--- a/fs/smb/client/smb2misc.c
+++ b/fs/smb/client/smb2misc.c
@@ -623,6 +623,8 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
 	/* look up tcon based on tid & uid */
 	spin_lock(&cifs_tcp_ses_lock);
 	list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
+		if (cifs_ses_exiting(ses))
+			continue;
 		list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
 			spin_lock(&tcon->open_file_lock);
 			cifs_stats_inc(
-- 
2.44.0


  parent reply	other threads:[~2024-04-02 19:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 19:33 [PATCH 01/12] smb: client: fix potential UAF in cifs_debug_files_proc_show() Paulo Alcantara
2024-04-02 19:33 ` [PATCH 02/12] smb: client: fix potential UAF in cifs_dump_full_key() Paulo Alcantara
2024-04-02 19:33 ` [PATCH 03/12] smb: client: fix potential UAF in cifs_stats_proc_write() Paulo Alcantara
2024-04-02 19:33 ` [PATCH 04/12] smb: client: fix potential UAF in cifs_stats_proc_show() Paulo Alcantara
2024-04-02 19:33 ` [PATCH 05/12] smb: client: fix potential UAF in smb2_check_message() Paulo Alcantara
2024-04-02 19:33 ` Paulo Alcantara [this message]
2024-04-02 19:33 ` [PATCH 07/12] smb: client: fix potential UAF in smb2_is_valid_oplock_break() Paulo Alcantara
2024-04-02 19:34 ` [PATCH 08/12] smb: client: fix potential UAF in is_valid_oplock_break() Paulo Alcantara
2024-04-02 19:34 ` [PATCH 09/12] smb: client: fix potential UAF in smb2_get_sign_key() Paulo Alcantara
2024-04-02 22:02   ` Paulo Alcantara
2024-04-02 19:34 ` [PATCH 10/12] smb: client: fix potential UAF in smb2_is_network_name_deleted() Paulo Alcantara
2024-04-02 19:34 ` [PATCH 11/12] smb: client: fix potential UAF in smb2_get_enc_key() Paulo Alcantara
2024-04-02 21:40   ` Steve French
2024-04-02 21:48     ` Paulo Alcantara
2024-04-02 22:43   ` Paulo Alcantara
2024-04-02 19:34 ` [PATCH 12/12] smb: client: fix potential UAF in cifs_signal_cifsd_for_reconnect() Paulo Alcantara
2024-06-01 11:31 ` [PATCH 01/12] smb: client: fix potential UAF in cifs_debug_files_proc_show() Wang Zhaolong
2024-06-01 21:14   ` Paulo Alcantara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240402193404.236159-6-pc@manguebit.com \
    --to=pc@manguebit.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox