mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin Ian King <colin.i.king@gmail.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] fs: Fix uninitialized variable uflags
Date: Wed, 26 Feb 2025 22:39:12 +0000	[thread overview]
Message-ID: <20250226223913.591371-1-colin.i.king@gmail.com> (raw)

The variable uflags is only being initialized in the if statement that
checks if flags & MOVE_MOUNT_F_EMPTY_PATH is non-zero.  Fix this by
initializing uflags at the start of the system call move_mount.

Fixes: b1e9423d65e3 ("fs: support getname_maybe_null() in move_mount()")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 663bacefddfa..c19e919a9108 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -4599,7 +4599,7 @@ SYSCALL_DEFINE5(move_mount,
 	struct path from_path __free(path_put) = {};
 	struct filename *to_name __free(putname) = NULL;
 	struct filename *from_name __free(putname) = NULL;
-	unsigned int lflags, uflags;
+	unsigned int lflags, uflags = 0;
 	enum mnt_tree_flags_t mflags = 0;
 	int ret = 0;
 
-- 
2.47.2


             reply	other threads:[~2025-02-26 22:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26 22:39 Colin Ian King [this message]
2025-02-27  8:09 ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250226223913.591371-1-colin.i.king@gmail.com \
    --to=colin.i.king@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®