linux/fs/ksmbd
Namjae Jeon bb5bf157b5 ksmbd: replace one-element array with flex-array member in struct smb2_ea_info
commit 0ba5439d9a upstream.

UBSAN complains about out-of-bounds array indexes on 1-element arrays in
struct smb2_ea_info.

UBSAN: array-index-out-of-bounds in fs/smb/server/smb2pdu.c:4335:15
index 1 is out of range for type 'char [1]'
CPU: 1 PID: 354 Comm: kworker/1:4 Not tainted 6.5.0-rc4 #1
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop
Reference Platform, BIOS 6.00 07/22/2020
Workqueue: ksmbd-io handle_ksmbd_work [ksmbd]
Call Trace:
 <TASK>
 __dump_stack linux/lib/dump_stack.c:88
 dump_stack_lvl+0x48/0x70 linux/lib/dump_stack.c:106
 dump_stack+0x10/0x20 linux/lib/dump_stack.c:113
 ubsan_epilogue linux/lib/ubsan.c:217
 __ubsan_handle_out_of_bounds+0xc6/0x110 linux/lib/ubsan.c:348
 smb2_get_ea linux/fs/smb/server/smb2pdu.c:4335
 smb2_get_info_file linux/fs/smb/server/smb2pdu.c:4900
 smb2_query_info+0x63ae/0x6b20 linux/fs/smb/server/smb2pdu.c:5275
 __process_request linux/fs/smb/server/server.c:145
 __handle_ksmbd_work linux/fs/smb/server/server.c:213
 handle_ksmbd_work+0x348/0x10b0 linux/fs/smb/server/server.c:266
 process_one_work+0x85a/0x1500 linux/kernel/workqueue.c:2597
 worker_thread+0xf3/0x13a0 linux/kernel/workqueue.c:2748
 kthread+0x2b7/0x390 linux/kernel/kthread.c:389
 ret_from_fork+0x44/0x90 linux/arch/x86/kernel/process.c:145
 ret_from_fork_asm+0x1b/0x30 linux/arch/x86/entry/entry_64.S:304
 </TASK>

Cc: stable@vger.kernel.org
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>
2023-09-06 21:28:37 +01:00
..
mgmt ksmbd: fix racy issue while destroying session on multichannel 2023-05-17 11:50:28 +02:00
asn1.c
asn1.h
auth.c ksmbd: fix deadlock in ksmbd_find_crypto_ctx() 2023-05-17 11:50:29 +02:00
auth.h ksmbd: fix racy issue while destroying session on multichannel 2023-05-17 11:50:28 +02:00
connection.c ksmbd: allocate one more byte for implied bcc[0] 2023-05-24 17:36:54 +01:00
connection.h ksmbd: fix racy issue while destroying session on multichannel 2023-05-17 11:50:28 +02:00
crypto_ctx.c ksmbd: remove NTLMv1 authentication 2021-09-29 16:17:34 -05:00
crypto_ctx.h ksmbd: remove NTLMv1 authentication 2021-09-29 16:17:34 -05:00
glob.h ksmbd: fix version mismatch with out of tree 2021-10-07 10:18:34 -05:00
Kconfig ksmbd: set unique value to volume serial field in FS_VOLUME_INFORMATION 2021-11-18 19:16:07 +01:00
ksmbd_netlink.h ksmbd: add max connections parameter 2023-02-01 08:27:24 +01:00
ksmbd_spnego_negtokeninit.asn1
ksmbd_spnego_negtokentarg.asn1
ksmbd_work.c ksmbd: reorder and document on-disk and netlink structures in headers 2021-06-30 14:47:24 +09:00
ksmbd_work.h ksmbd: change data type of volatile/persistent id to u64 2021-07-09 08:23:16 +09:00
Makefile
misc.c ksmbd: missing check for NULL in convert_to_nt_pathname() 2021-09-30 20:00:05 -05:00
misc.h ksmbd: use LOOKUP_BENEATH to prevent the out of share access 2021-09-24 21:25:23 -05:00
ndr.c ksmbd: downgrade ndr version error message to debug 2023-02-01 08:27:24 +01:00
ndr.h ksmbd: add user namespace support 2021-07-02 16:27:10 +09:00
nterr.h
ntlmssp.h
oplock.c ksmbd: fix wrong DataOffset validation of create context 2023-09-06 21:28:37 +01:00
oplock.h ksmbd: fix global-out-of-bounds in smb2_find_context_vals 2023-05-24 17:36:54 +01:00
server.c ksmbd: validate session id and tree id in the compound request 2023-07-23 13:47:39 +02:00
server.h ksmbd: add max connections parameter 2023-02-01 08:27:24 +01:00
smb2misc.c ksmbd: validate command request size 2023-08-16 18:21:57 +02:00
smb2ops.c ksmbd: add support for smb2 max credit parameter 2022-01-27 11:02:53 +01:00
smb2pdu.c ksmbd: replace one-element array with flex-array member in struct smb2_ea_info 2023-09-06 21:28:37 +01:00
smb2pdu.h ksmbd: replace one-element array with flex-array member in struct smb2_ea_info 2023-09-06 21:28:37 +01:00
smb_common.c ksmbd: avoid field overflow warning 2023-07-23 13:47:18 +02:00
smb_common.h ksmbd: fix racy issue while destroying session on multichannel 2023-05-17 11:50:28 +02:00
smbacl.c ksmbd: fix heap-based overflow in set_ntacl_dacl() 2022-08-21 15:17:48 +02:00
smbacl.h ksmbd: fix heap-based overflow in set_ntacl_dacl() 2022-08-21 15:17:48 +02:00
smbfsctl.h
smbstatus.h
transport_ipc.c ksmbd: add max connections parameter 2023-02-01 08:27:24 +01:00
transport_ipc.h ksmbd: throttle session setup failures to avoid dictionary attacks 2021-10-20 00:07:10 -05:00
transport_rdma.c ksmbd: don't terminate inactive sessions after a few seconds 2023-04-05 11:24:52 +02:00
transport_rdma.h ksmbd: add smbd max io size parameter 2023-02-01 08:27:24 +01:00
transport_tcp.c ksmbd: don't terminate inactive sessions after a few seconds 2023-04-05 11:24:52 +02:00
transport_tcp.h
unicode.c
unicode.h
uniupr.h
vfs_cache.c ksmbd: fix racy issue while destroying session on multichannel 2023-05-17 11:50:28 +02:00
vfs_cache.h ksmbd: remove unused ksmbd_file_table_flush function 2021-09-03 23:29:45 -05:00
vfs.c ksmbd: remove internal.h include 2023-08-03 10:22:30 +02:00
vfs.h ksmbd: don't align last entry offset in smb2 query directory 2022-02-23 12:03:18 +01:00
xattr.h ksmbd: reorder and document on-disk and netlink structures in headers 2021-06-30 14:47:24 +09:00