]> git.hungrycats.org Git - linux/commit
ksmbd: use opener credentials for delete-on-close
authorNamjae Jeon <linkinjeon@kernel.org>
Sat, 13 Jun 2026 13:00:00 +0000 (22:00 +0900)
committerSteve French <stfrench@microsoft.com>
Tue, 16 Jun 2026 23:57:22 +0000 (18:57 -0500)
commit52e2f21911158ec961cd5aae19c56460db382af0
tree59fb734828dd968c0015037600f86598f1b35474
parentbe6d26bf27499977c746abc163659915082348d8
ksmbd: use opener credentials for delete-on-close

Delete-on-close can be completed by deferred or durable handle teardown,
where no request work is available. Both the base-file unlink and the ADS
xattr removal consequently run with the ksmbd worker credentials and can
bypass filesystem permission checks.

Run both operations with the credentials captured in struct file when the
handle was opened. This preserves the authenticated user's fsuid, fsgid,
supplementary groups and capability restrictions at final close.

Cc: stable@vger.kernel.org
Reported-by: Musaab Khan <musaab.khan@protonmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/vfs.c
fs/smb/server/vfs_cache.c