Re: [PATCH] ksmbd: allocate the security descriptor reply at its padded size

From: Namjae Jeon

Date: Wed Nov 18 2026 - 19:38:26 EST


On Thu, Nov 19, 2026 at 2:35 AM Ian Bridges <icb@xxxxxxxxxxxx> wrote:
>
> smb2_get_info_sec() allocates the security descriptor reply with the
> size that smb_acl_sec_desc_scratch_len() estimates. A compound response
> pads the reply to 8 bytes inside that buffer, so after build_sec_desc()
> the query fails with -EFBIG when the padded length does not fit. The
> estimate is not padded, so a descriptor that fits the estimate can
> still fail. A query with AdditionalInformation 0 always fails with
> -EFBIG. Its reply is the 20-byte header, the estimate is 20 bytes, and
> the padded length is 24. The client gets an error instead of the
> header.
>
> Round the allocation up to 8 bytes, as READ does for its data buffer.
>
> Fixes: fda9522ed6af ("ksmbd: fix OOB write in QUERY_INFO for compound requests")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Ian Bridges <icb@xxxxxxxxxxxx>
Applied it to #ksmbd-for-next.
Thanks!