Re: [PATCH] ksmbd: store the security descriptor from a copy
From: Namjae Jeon
Date: Tue Nov 17 2026 - 05:46:02 EST
On Tue, Nov 17, 2026 at 8:19 AM Ian Bridges <icb@xxxxxxxxxxxx> wrote:
>
> Storing a security descriptor changes the buffer passed by the caller.
> ksmbd_vfs_set_sd_xattr() adjusts three offsets for the on-disk format in
> place. For SET_INFO, and for CREATE with a security descriptor context,
> this modifies the client's request buffer. Current callers do not reuse
> the descriptor after storing it, but a later reader would find incorrect
> offsets.
>
> Adjust the offsets in a private copy and make the input argument const.
> Reject a length shorter than the descriptor header before copying it.
> This keeps the caller's data intact and preserves the stored format.
>
> Add a KUnit test that checks the input stays unchanged after a
> successful store and after a short length is rejected.
>
> Signed-off-by: Ian Bridges <icb@xxxxxxxxxxxx>
Applied it to #ksmbd-for-next.
Thanks.