Re: [PATCH] ksmbd: revert fsids on durable reconnect and replay failure

From: Namjae Jeon

Date: Thu Oct 29 2026 - 04:20:23 EST


On Thu, Oct 29, 2026 at 10:28 AM Ian Bridges <icb@xxxxxxxxxxxx> wrote:
>
> On a durable handle reconnect or a request replay, smb2_open() switches
> to the SMB user's fsids before calling ksmbd_vfs_getattr(). If that call
> fails, the code jumps to err_out2 and skips ksmbd_revert_fsids() at
> err_out1. The user's credentials then stay installed on the shared ksmbd
> worker. Later work on that worker, including other users' requests, runs
> with the first user's fsuid, fsgid and supplementary groups.
> ksmbd_free_work_struct() also warns, because work->saved_cred is still
> set.
>
> Jump to err_out1 instead. No path is held at this point, so skipping the
> path_put() at err_out is correct.
>
> Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
> Fixes: bb8bf7eb13b5 ("ksmbd: add SMB3 request replay support")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Ian Bridges <icb@xxxxxxxxxxxx>
Applied it to #ksmbd-for-next.
Thanks!