linux/fs/smb/server
Shota Zaizen 996454bc0d ksmbd: validate inherited ACE SID length
smb_inherit_dacl() walks the parent directory DACL loaded from the
security descriptor xattr. It verifies that each ACE contains the fixed
SID header before using it, but does not verify that the variable-length
SID described by sid.num_subauth is fully contained in the ACE.

A malformed inheritable ACE can advertise more subauthorities than are
present in the ACE. compare_sids() may then read past the ACE.
smb_set_ace() also clamps the copied destination SID, but used the
unchecked source SID count to compute the inherited ACE size. That could
advance the temporary inherited ACE buffer pointer and nt_size accounting
past the allocated buffer.

Fix this by validating the parent ACE SID count and SID length before
using the SID during inheritance. Compute the inherited ACE size from the
copied SID so the size matches the bounded destination SID. Reject the
inherited DACL if size accumulation would overflow smb_acl.size or the
security descriptor allocation size.

Fixes: e2f34481b2 ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Shota Zaizen <s@zaizen.me>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2026-05-01 21:49:35 -05:00
..
mgmt ksmbd: fail share config requests when path allocation fails 2026-05-01 21:49:35 -05:00
asn1.c ksmbd: use __GFP_RETRY_MAYFAIL 2024-11-25 18:58:02 -06:00
asn1.h
auth.c ksmbd: Use AES-CMAC library for SMB3 signature calculation 2026-04-22 08:11:23 -05:00
auth.h ksmbd: Use AES-CMAC library for SMB3 signature calculation 2026-04-22 08:11:23 -05:00
connection.c ksmbd: fix kernel-doc warnings from ksmbd_conn_get/put() 2026-05-01 21:49:35 -05:00
connection.h ksmbd: centralize ksmbd_conn final release to plug transport leak 2026-05-01 21:49:35 -05:00
crypto_ctx.c ksmbd: Use AES-CMAC library for SMB3 signature calculation 2026-04-22 08:11:23 -05:00
crypto_ctx.h ksmbd: Use AES-CMAC library for SMB3 signature calculation 2026-04-22 08:11:23 -05:00
glob.h ksmbd: use __GFP_RETRY_MAYFAIL 2024-11-25 18:58:02 -06:00
Kconfig smb: smbdirect: move fs/smb/common/smbdirect/ to fs/smb/smbdirect/ 2026-04-22 19:00:41 -05: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
Makefile ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06: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: centralize ksmbd_conn final release to plug transport leak 2026-05-01 21:49:35 -05:00
oplock.h ksmbd: validate owner of durable handle on reconnect 2026-04-12 18:07:54 -05:00
proc.c ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
server.c ksmbd: centralize ksmbd_conn final release to plug transport leak 2026-05-01 21:49:35 -05:00
server.h ksmbd: add max ip connections parameter 2025-09-30 21:37:54 -05:00
smb_common.c ksmbd: add procfs interface for runtime monitoring and statistics 2026-02-08 20:25:16 -06:00
smb_common.h smb: move filesystem_vol_info into common/fscc.h 2026-04-12 18:07: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: harden file lifetime during session teardown 2026-05-01 21:49:35 -05:00
smb2pdu.h smb: move file_basic_info into common/fscc.h 2026-04-12 18:07:54 -05:00
smbacl.c ksmbd: validate inherited ACE SID length 2026-05-01 21:49:35 -05:00
smbacl.h ksmbd: fix OOB write in QUERY_INFO for compound requests 2026-03-29 22:07:45 -05: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: validate response sizes in ipc_validate_msg() 2026-04-18 12:19:59 -05:00
transport_ipc.h ksmbd: Remove unused functions 2025-01-15 23:24:51 -06:00
transport_rdma.c smb: smbdirect: introduce and use include/linux/smbdirect.h 2026-05-01 16:24:25 -05:00
transport_rdma.h smb: smbdirect: introduce and use include/linux/smbdirect.h 2026-05-01 16:24:25 -05:00
transport_tcp.c smb: server: fix max_connections off-by-one in tcp accept path 2026-04-18 12:19:59 -05: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 fs/smb: Swing unicode common code from smb->NLS 2023-08-30 08:55:51 -05:00
vfs_cache.c ksmbd: close durable scavenger races against m_fp_list lookups 2026-05-01 21:49:35 -05:00
vfs_cache.h ksmbd: harden file lifetime during session teardown 2026-05-01 21:49:35 -05:00
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
xattr.h ksmbd: Correct typos in multiple comments across various files 2024-09-25 21:33:22 -05:00