This patch add the validation for smb request protocol id. If it is not one of the four ids(SMB1_PROTO_NUMBER, SMB2_PROTO_NUMBER, SMB2_TRANSFORM_PROTO_NUM, SMB2_COMPRESSION_TRANSFORM_ID), don't allow processing the request. And this will fix the following KASAN warning also. [ 13.905265] BUG: KASAN: slab-out-of-bounds in init_smb2_rsp_hdr+0x1b9/0x1f0 [ 13.905900] Read of size 16 at addr ffff888005fd2f34 by task kworker/0:2/44 ... [ 13.908553] Call Trace: [ 13.908793] <TASK> [ 13.908995] dump_stack_lvl+0x33/0x50 [ 13.909369] print_report+0xcc/0x620 [ 13.910870] kasan_report+0xae/0xe0 [ 13.911519] kasan_check_range+0x35/0x1b0 [ 13.911796] init_smb2_rsp_hdr+0x1b9/0x1f0 [ 13.912492] handle_ksmbd_work+0xe5/0x820 Cc: stable@vger.kernel.org Reported-by: Chih-Yen Chang <cc85nod@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> |
||
|---|---|---|
| .. | ||
| mgmt | ||
| Kconfig | ||
| Makefile | ||
| asn1.c | ||
| asn1.h | ||
| auth.c | ||
| auth.h | ||
| connection.c | ||
| connection.h | ||
| crypto_ctx.c | ||
| crypto_ctx.h | ||
| glob.h | ||
| ksmbd_netlink.h | ||
| ksmbd_spnego_negtokeninit.asn1 | ||
| ksmbd_spnego_negtokentarg.asn1 | ||
| ksmbd_work.c | ||
| ksmbd_work.h | ||
| misc.c | ||
| misc.h | ||
| ndr.c | ||
| ndr.h | ||
| nterr.h | ||
| ntlmssp.h | ||
| oplock.c | ||
| oplock.h | ||
| server.c | ||
| server.h | ||
| smb2misc.c | ||
| smb2ops.c | ||
| smb2pdu.c | ||
| smb2pdu.h | ||
| smb_common.c | ||
| smb_common.h | ||
| smbacl.c | ||
| smbacl.h | ||
| smbfsctl.h | ||
| smbstatus.h | ||
| transport_ipc.c | ||
| transport_ipc.h | ||
| transport_rdma.c | ||
| transport_rdma.h | ||
| transport_tcp.c | ||
| transport_tcp.h | ||
| unicode.c | ||
| unicode.h | ||
| uniupr.h | ||
| vfs.c | ||
| vfs.h | ||
| vfs_cache.c | ||
| vfs_cache.h | ||
| xattr.h | ||