mirror-linux/fs/smb/server
Namjae Jeon beef2634f8 ksmbd: fix potencial OOB in get_file_all_info() for compound requests
When a compound request consists of QUERY_DIRECTORY + QUERY_INFO
(FILE_ALL_INFORMATION) and the first command consumes nearly the entire
max_trans_size, get_file_all_info() would blindly call smbConvertToUTF16()
with PATH_MAX, causing out-of-bounds write beyond the response buffer.
In get_file_all_info(), there was a missing validation check for
the client-provided OutputBufferLength before copying the filename into
FileName field of the smb2_file_all_info structure.
If the filename length exceeds the available buffer space, it could lead to
potential buffer overflows or memory corruption during smbConvertToUTF16
conversion. This calculating the actual free buffer size using
smb2_calc_max_out_buf_len() and returning -EINVAL if the buffer is
insufficient and updating smbConvertToUTF16 to use the actual filename
length (clamped by PATH_MAX) to ensure a safe copy operation.

Cc: stable@vger.kernel.org
Fixes: e2b76ab8b5 ("ksmbd: add support for read compound")
Reported-by: Asim Viladi Oglu Manizada <manizada@pm.me>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2026-03-25 18:58:40 -05:00
..
mgmt ksmbd: fix share_conf UAF in tree_conn disconnect 2026-03-17 21:45:29 -05:00
Kconfig ksmbd: Compare MACs in constant time 2026-02-22 21:27:28 -06:00
Makefile ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
asn1.c ksmbd: use __GFP_RETRY_MAYFAIL 2024-11-25 18:58:02 -06:00
asn1.h
auth.c ksmbd: Don't log keys in SMB3 signing and encryption key generation 2026-03-08 21:28:39 -05:00
auth.h ksmbd: Use HMAC-SHA256 library for message signing and key generation 2025-11-30 21:11:43 -06:00
connection.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
connection.h ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
crypto_ctx.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
crypto_ctx.h ksmbd: Use HMAC-MD5 library for NTLMv2 2025-11-30 21:11:43 -06:00
glob.h ksmbd: use __GFP_RETRY_MAYFAIL 2024-11-25 18:58:02 -06:00
ksmbd_netlink.h ksmbd: add max ip connections parameter 2025-09-30 21:37:54 -05:00
ksmbd_spnego_negtokeninit.asn1 treewide: Add SPDX identifier to IETF ASN.1 modules 2023-10-27 18:04:28 +08:00
ksmbd_spnego_negtokentarg.asn1 treewide: Add SPDX identifier to IETF ASN.1 modules 2023-10-27 18:04:28 +08:00
ksmbd_work.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ksmbd_work.h ksmbd: fix use-after-free in ksmbd_free_work_struct 2025-03-10 12:54:28 -05:00
misc.c ksmbd: Replace strcpy + strcat to improve convert_to_nt_pathname 2025-11-30 21:11:45 -06:00
misc.h ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
ndr.c ksmbd: use __GFP_RETRY_MAYFAIL 2024-11-25 18:58:02 -06:00
ndr.h
ntlmssp.h
oplock.c ksmbd: fix use-after-free and NULL deref in smb_grant_oplock() 2026-03-22 17:15:00 -05:00
oplock.h ksmbd: fix use-after-free by using call_rcu() for oplock_info 2026-03-08 21:28:39 -05:00
proc.c ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
server.c kmalloc_obj treewide refactoring for v7.0-rc1 2026-02-21 11:02:58 -08:00
server.h ksmbd: add max ip connections parameter 2025-09-30 21:37:54 -05:00
smb2misc.c smb/server: remove unused nterr.h 2025-12-09 21:01:16 -06:00
smb2ops.c ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
smb2pdu.c ksmbd: fix potencial OOB in get_file_all_info() for compound requests 2026-03-25 18:58:40 -05:00
smb2pdu.h smb: update some doc references 2026-03-01 17:59:52 -06:00
smb_common.c ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
smb_common.h ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
smbacl.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
smbacl.h smb: common: change the data type of num_aces to le16 2025-03-02 22:50:54 -06:00
smbfsctl.h
stats.h ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
transport_ipc.c ksmbd: ipc: fix use-after-free in ipc_msg_send_request 2025-11-30 21:11:45 -06:00
transport_ipc.h ksmbd: Remove unused functions 2025-01-15 23:24:51 -06:00
transport_rdma.c ksmbd: fix signededness bug in smb_direct_prepare_negotiation() 2026-02-22 21:27:33 -06:00
transport_rdma.h smb: server: pass ksmbd_transport to get_smbd_max_read_write_size() 2025-09-28 18:29:52 -05:00
transport_tcp.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
transport_tcp.h ksmbd: fix use-after-free in __smb2_lease_break_noti() 2025-04-14 22:21:26 -05:00
unicode.c ksmbd: use __GFP_RETRY_MAYFAIL 2024-11-25 18:58:02 -06:00
unicode.h
vfs.c vfs-7.0-rc1.misc.2 2026-02-16 13:00:36 -08:00
vfs.h smb/server: use end_removing_noperm for for target of smb2_create_link() 2025-11-14 13:15:56 +01:00
vfs_cache.c ksmbd: fix use-after-free in proc_show_files due to early rcu_read_unlock 2026-03-08 21:28:39 -05:00
vfs_cache.h ksmbd: allow a filename to contain colons on SMB3.1.1 posix extensions 2025-08-31 17:48:38 -05:00
xattr.h ksmbd: Correct typos in multiple comments across various files 2024-09-25 21:33:22 -05:00