[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250227-abbruch-geknickt-c6522ef250a7@brauner>
Date: Thu, 27 Feb 2025 09:13:10 +0100
From: Christian Brauner <brauner@...nel.org>
To: "Paul E. McKenney" <paulmck@...nel.org>
Cc: viro@...iv.linux.org.uk, jack@...e.cz, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, sfr@...b.auug.org.au, linux-next@...r.kernel.org
Subject: Re: [PATCH RFC namespace] Fix uninitialized uflags in
SYSCALL_DEFINE5(move_mount)
On Wed, Feb 26, 2025 at 11:18:49AM -0800, Paul E. McKenney wrote:
> The next-20250226 release gets an uninitialized-variable warning from the
> move_mount syscall in builds with clang 19.1.5. This variable is in fact
> assigned only if the MOVE_MOUNT_F_EMPTY_PATH flag is set, but is then
> unconditionally passed to getname_maybe_null(), which unconditionally
> references it.
>
> This patch simply sets uflags to zero in the same manner as is done
> for lflags, which makes rcutorture happy, but might or might not be a
> proper patch.
>
> Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
> Cc: Alexander Viro <viro@...iv.linux.org.uk>
> Cc: Christian Brauner <brauner@...nel.org>
> Cc: Jan Kara <jack@...e.cz>
> Cc: <linux-fsdevel@...r.kernel.org>
> Cc: <linux-kernel@...r.kernel.org>
> ---
Hey Paul! Thank you for the patch. The fix is correct but I've already
taken a patch from Arnd yesterday. So hopefully you'll forgive me for
not taking yours. :)
> namespace.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 663bacefddfa6..80505d533cd23 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -4617,6 +4617,7 @@ SYSCALL_DEFINE5(move_mount,
> if (flags & MOVE_MOUNT_BENEATH) mflags |= MNT_TREE_BENEATH;
>
> lflags = 0;
> + uflags = 0;
> if (flags & MOVE_MOUNT_F_SYMLINKS) lflags |= LOOKUP_FOLLOW;
> if (flags & MOVE_MOUNT_F_AUTOMOUNTS) lflags |= LOOKUP_AUTOMOUNT;
> if (flags & MOVE_MOUNT_F_EMPTY_PATH) uflags = AT_EMPTY_PATH;
> @@ -4625,6 +4626,7 @@ SYSCALL_DEFINE5(move_mount,
> return PTR_ERR(from_name);
>
> lflags = 0;
> + uflags = 0;
> if (flags & MOVE_MOUNT_T_SYMLINKS) lflags |= LOOKUP_FOLLOW;
> if (flags & MOVE_MOUNT_T_AUTOMOUNTS) lflags |= LOOKUP_AUTOMOUNT;
> if (flags & MOVE_MOUNT_T_EMPTY_PATH) uflags = AT_EMPTY_PATH;
Powered by blists - more mailing lists