linux/fs/smb/server
Namjae Jeon 118fd99761 ksmbd: fix race condition between destroy_previous_session() and smb2 operations()
[ Upstream commit 76e98a158b ]

If there is ->PreviousSessionId field in the session setup request,
The session of the previous connection should be destroyed.
During this, if the smb2 operation requests in the previous session are
being processed, a racy issue could happen with ksmbd_destroy_file_table().
This patch sets conn->status to KSMBD_SESS_NEED_RECONNECT to block
incoming  operations and waits until on-going operations are complete
(i.e. idle) before desctorying the previous session.

Fixes: c8efcc7861 ("ksmbd: add support for durable handles v1/v2")
Cc: stable@vger.kernel.org # v6.6+
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-25040
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-08-29 17:33:59 +02:00
..
mgmt ksmbd: fix race condition between destroy_previous_session() and smb2 operations() 2024-08-29 17:33:59 +02:00
asn1.c ksmbd: validate mech token in session setup 2024-01-25 15:35:44 -08:00
asn1.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
auth.c ksmbd: auth: fix most kernel-doc warnings 2024-05-25 16:22:44 +02:00
auth.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
connection.c ksmbd: fix race condition between destroy_previous_session() and smb2 operations() 2024-08-29 17:33:59 +02:00
connection.h ksmbd: fix race condition between destroy_previous_session() and smb2 operations() 2024-08-29 17:33:59 +02:00
crypto_ctx.c smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
crypto_ctx.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
glob.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
Kconfig ksmbd: remove experimental warning 2023-09-03 21:06:36 -05:00
ksmbd_netlink.h ksmbd: add continuous availability share parameter 2024-05-25 16:22:52 +02:00
ksmbd_spnego_negtokeninit.asn1 smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
ksmbd_spnego_negtokentarg.asn1 smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
ksmbd_work.c ksmbd: release interim response after sending status pending response 2024-01-05 15:19:39 +01:00
ksmbd_work.h ksmbd: fix wrong interim response on compound 2023-08-29 12:30:19 -05:00
Makefile smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
misc.c ksmbd: Add kernel-doc for ksmbd_extract_sharename() function 2024-05-25 16:22:46 +02:00
misc.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
ndr.c smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
ndr.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
nterr.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
ntlmssp.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
oplock.c ksmbd: use rwsem instead of rwlock for lease break 2024-06-21 14:38:21 +02:00
oplock.h ksmbd: add support for durable handles v1/v2 2024-05-25 16:22:49 +02:00
server.c ksmbd: fix slab-out-of-bounds in smb2_allocate_rsp_buf 2024-04-27 17:11:43 +02:00
server.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
smb2misc.c ksmbd: fix potencial out-of-bounds when buffer offset is invalid 2024-05-25 16:22:50 +02:00
smb2ops.c ksmbd: add support for durable handles v1/v2 2024-05-25 16:22:49 +02:00
smb2pdu.c ksmbd: fix race condition between destroy_previous_session() and smb2 operations() 2024-08-29 17:33:59 +02:00
smb2pdu.h smb: smb2pdu.h: Avoid -Wflex-array-member-not-at-end warnings 2024-05-25 16:22:52 +02:00
smb_common.c ksmbd: use rwsem instead of rwlock for lease break 2024-06-21 14:38:21 +02:00
smb_common.h ksmbd: fix out of bounds in init_smb2_rsp_hdr() 2023-07-23 10:25:11 -05:00
smbacl.c ksmbd: free ppace array on error in parse_dacl 2024-01-20 11:51:48 +01:00
smbacl.h ksmbd: fix possible deadlock in smb2_open 2023-12-08 08:52:15 +01:00
smbfsctl.h cifs: correct references in Documentation to old fs/cifs path 2023-05-24 16:29:21 -05:00
smbstatus.h cifs: correct references in Documentation to old fs/cifs path 2023-05-24 16:29:21 -05:00
transport_ipc.c ksmbd: validate payload size in ipc response 2024-04-10 16:36:02 +02:00
transport_ipc.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
transport_rdma.c ksmbd: fix UAF issue in ksmbd_tcp_new_connection() 2024-01-25 15:35:44 -08:00
transport_rdma.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
transport_tcp.c smb: Fix some kernel-doc comments 2024-05-25 16:22:45 +02:00
transport_tcp.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00
unicode.c ksmbd: add support for surrogate pair conversion 2024-01-05 15:19:38 +01:00
unicode.h fs/smb: Swing unicode common code from smb->NLS 2023-08-30 08:55:51 -05:00
vfs.c ksmbd: fix missing use of get_write in in smb2_set_ea() 2024-06-21 14:38:36 +02:00
vfs.h ksmbd: fix missing use of get_write in in smb2_set_ea() 2024-06-21 14:38:36 +02:00
vfs_cache.c ksmbd: fix missing use of get_write in in smb2_set_ea() 2024-06-21 14:38:36 +02:00
vfs_cache.h ksmbd: use rwsem instead of rwlock for lease break 2024-06-21 14:38:21 +02:00
xattr.h smb: move client and server files to common directory fs/smb 2023-05-24 16:29:21 -05:00