diff options
author | Paulo Alcantara <pc@manguebit.com> | 2024-04-02 21:34:02 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-04-03 21:45:06 +0200 |
commit | 63981561ffd2d4987807df4126f96a11e18b0c1d (patch) | |
tree | 1248fde1a5d029f9b879b2a55270f59cb6ab255a /fs/smb | |
parent | smb: client: fix potential UAF in is_valid_oplock_break() (diff) | |
download | linux-63981561ffd2d4987807df4126f96a11e18b0c1d.tar.xz linux-63981561ffd2d4987807df4126f96a11e18b0c1d.zip |
smb: client: fix potential UAF in smb2_is_network_name_deleted()
Skip sessions that are being teared down (status == SES_EXITING) to
avoid UAF.
Cc: stable@vger.kernel.org
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb')
-rw-r--r-- | fs/smb/client/smb2ops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 87b63f6ad2e2..b156eefa75d7 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -2481,6 +2481,8 @@ smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server) 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) { if (tcon->tid == le32_to_cpu(shdr->Id.SyncId.TreeId)) { spin_lock(&tcon->tc_lock); |