* [PATCH] fs: fix incorrect lflags value in the move_mount syscall
@ 2025-08-11 5:24 Yuntao Wang
2025-08-11 14:06 ` Christian Brauner
2025-08-11 14:07 ` Christian Brauner
0 siblings, 2 replies; 4+ messages in thread
From: Yuntao Wang @ 2025-08-11 5:24 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel
Cc: Alexander Viro, Christian Brauner, Jan Kara, Yuntao Wang
The lflags value used to look up from_path was overwritten by the one used
to look up to_path.
In other words, from_path was looked up with the wrong lflags value. Fix it.
Fixes: f9fde814de37 ("fs: support getname_maybe_null() in move_mount()")
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
---
fs/namespace.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index ddfd4457d338..43665cb6df28 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -4551,20 +4551,13 @@ SYSCALL_DEFINE5(move_mount,
if (flags & MOVE_MOUNT_SET_GROUP) mflags |= MNT_TREE_PROPAGATION;
if (flags & MOVE_MOUNT_BENEATH) mflags |= MNT_TREE_BENEATH;
- lflags = 0;
- if (flags & MOVE_MOUNT_F_SYMLINKS) lflags |= LOOKUP_FOLLOW;
- if (flags & MOVE_MOUNT_F_AUTOMOUNTS) lflags |= LOOKUP_AUTOMOUNT;
- uflags = 0;
- if (flags & MOVE_MOUNT_F_EMPTY_PATH) uflags = AT_EMPTY_PATH;
- from_name = getname_maybe_null(from_pathname, uflags);
- if (IS_ERR(from_name))
- return PTR_ERR(from_name);
-
lflags = 0;
if (flags & MOVE_MOUNT_T_SYMLINKS) lflags |= LOOKUP_FOLLOW;
if (flags & MOVE_MOUNT_T_AUTOMOUNTS) lflags |= LOOKUP_AUTOMOUNT;
+
uflags = 0;
if (flags & MOVE_MOUNT_T_EMPTY_PATH) uflags = AT_EMPTY_PATH;
+
to_name = getname_maybe_null(to_pathname, uflags);
if (IS_ERR(to_name))
return PTR_ERR(to_name);
@@ -4582,6 +4575,17 @@ SYSCALL_DEFINE5(move_mount,
return ret;
}
+ lflags = 0;
+ if (flags & MOVE_MOUNT_F_SYMLINKS) lflags |= LOOKUP_FOLLOW;
+ if (flags & MOVE_MOUNT_F_AUTOMOUNTS) lflags |= LOOKUP_AUTOMOUNT;
+
+ uflags = 0;
+ if (flags & MOVE_MOUNT_F_EMPTY_PATH) uflags = AT_EMPTY_PATH;
+
+ from_name = getname_maybe_null(from_pathname, uflags);
+ if (IS_ERR(from_name))
+ return PTR_ERR(from_name);
+
if (!from_name && from_dfd >= 0) {
CLASS(fd_raw, f_from)(from_dfd);
if (fd_empty(f_from))
--
2.50.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] fs: fix incorrect lflags value in the move_mount syscall
2025-08-11 5:24 [PATCH] fs: fix incorrect lflags value in the move_mount syscall Yuntao Wang
@ 2025-08-11 14:06 ` Christian Brauner
2025-08-14 1:14 ` Yuntao Wang
2025-08-11 14:07 ` Christian Brauner
1 sibling, 1 reply; 4+ messages in thread
From: Christian Brauner @ 2025-08-11 14:06 UTC (permalink / raw)
To: Yuntao Wang
Cc: Christian Brauner, Alexander Viro, Jan Kara, linux-kernel,
linux-fsdevel
On Mon, 11 Aug 2025 13:24:26 +0800, Yuntao Wang wrote:
> The lflags value used to look up from_path was overwritten by the one used
> to look up to_path.
>
> In other words, from_path was looked up with the wrong lflags value. Fix it.
>
>
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] fs: fix incorrect lflags value in the move_mount syscall
https://git.kernel.org/vfs/vfs/c/593d9e4c3d63
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fs: fix incorrect lflags value in the move_mount syscall
2025-08-11 5:24 [PATCH] fs: fix incorrect lflags value in the move_mount syscall Yuntao Wang
2025-08-11 14:06 ` Christian Brauner
@ 2025-08-11 14:07 ` Christian Brauner
1 sibling, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2025-08-11 14:07 UTC (permalink / raw)
To: Yuntao Wang; +Cc: linux-kernel, linux-fsdevel, Alexander Viro, Jan Kara
On Mon, Aug 11, 2025 at 01:24:26PM +0800, Yuntao Wang wrote:
> The lflags value used to look up from_path was overwritten by the one used
> to look up to_path.
>
> In other words, from_path was looked up with the wrong lflags value. Fix it.
Right, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fs: fix incorrect lflags value in the move_mount syscall
2025-08-11 14:06 ` Christian Brauner
@ 2025-08-14 1:14 ` Yuntao Wang
0 siblings, 0 replies; 4+ messages in thread
From: Yuntao Wang @ 2025-08-14 1:14 UTC (permalink / raw)
To: brauner; +Cc: jack, linux-fsdevel, linux-kernel, viro, yuntao.wang
On Mon, 11 Aug 2025 16:06:59 +0200, Christian Brauner <brauner@kernel.org> wrote:
> On Mon, 11 Aug 2025 13:24:26 +0800, Yuntao Wang wrote:
> > The lflags value used to look up from_path was overwritten by the one used
> > to look up to_path.
> >
> > In other words, from_path was looked up with the wrong lflags value. Fix it.
> >
> >
>
> Applied to the vfs.fixes branch of the vfs/vfs.git tree.
> Patches in the vfs.fixes branch should appear in linux-next soon.
>
> Please report any outstanding bugs that were missed during review in a
> new review to the original patch series allowing us to drop it.
>
> It's encouraged to provide Acked-bys and Reviewed-bys even though the
> patch has now been applied. If possible patch trailers will be updated.
>
> Note that commit hashes shown below are subject to change due to rebase,
> trailer updates or similar. If in doubt, please check the listed branch.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
> branch: vfs.fixes
>
> [1/1] fs: fix incorrect lflags value in the move_mount syscall
> https://git.kernel.org/vfs/vfs/c/593d9e4c3d63
Hi Christian,
It seems the patch hasn't been applied to the vfs.fixes branch, the relevant
code there appears unchanged.
Thanks,
Yuntao
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-14 1:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 5:24 [PATCH] fs: fix incorrect lflags value in the move_mount syscall Yuntao Wang
2025-08-11 14:06 ` Christian Brauner
2025-08-14 1:14 ` Yuntao Wang
2025-08-11 14:07 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).