FAILED: patch "[PATCH] ksmbd: revert fsids on durable reconnect and replay failure" failed to apply to 6.6-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 539223f18026448f67d33d09719c355b91db7fd0
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 539223f18026448f67d33d09719c355b91db7fd0 Mon Sep 17 00:00:00 2001
From: Ian Bridges <[email protected]>
Date: Wed, 28 Oct 2026 20:28:03 -0500
Subject: [PATCH] ksmbd: revert fsids on durable reconnect and replay failure
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.
--- fs/smb/server/smb2pdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/smb/server/smb2pdu.c +2 -2
@@ -4530,7 +4530,7 @@ int smb2_open(struct ksmbd_work *work) file_info =FILE_OPENED ; rc =ksmbd_vfs_getattr (&fp->filp->f_path, &stat);if (rc) - goto err_out2; + goto err_out1; goto reconnected_fp; }
@@ -4560,7 +4560,7 @@ int smb2_open(struct ksmbd_work *work) rc =ksmbd_vfs_getattr (&fp->filp->f_path, &stat);if (rc) - goto err_out2; + goto err_out1; goto reconnected_fp; }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 ksmbd: revert fsids on durable reconnect and replay failure
From: Ian Bridges <[email protected]>
[ Upstream commit 539223f18026448f67d33d09719c355b91db7fd0 ]
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.
--- fs/smb/server/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/server/smb2pdu.c +1 -1
@@ -3101,7 +3101,7 @@ int smb2_open(struct ksmbd_work *work) rc =ksmbd_vfs_getattr (&fp->filp->f_path, &stat);if (rc) - goto err_out2; + goto err_out1; goto reconnected_fp; }
Signature · 1 line
2.53.0