* [PATCH][next] fs: Fix uninitialized variable uflags
@ 2025-02-26 22:39 Colin Ian King
2025-02-27 8:09 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-02-26 22:39 UTC (permalink / raw)
To: Alexander Viro, Christian Brauner, Jan Kara, linux-fsdevel
Cc: kernel-janitors, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH][next] fs: Fix uninitialized variable uflags
2025-02-26 22:39 [PATCH][next] fs: Fix uninitialized variable uflags Colin Ian King
@ 2025-02-27 8:09 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2025-02-27 8:09 UTC (permalink / raw)
To: Colin Ian King
Cc: Alexander Viro, Jan Kara, linux-fsdevel, kernel-janitors, linux-kernel
On Wed, Feb 26, 2025 at 10:39:12PM +0000, Colin Ian King wrote:
> 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>
> ---
Thanks, Colin. I've already taken in a patch from Arnd Bergmann
yesterday. So this should already be fixed.
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-27 8:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-26 22:39 [PATCH][next] fs: Fix uninitialized variable uflags Colin Ian King
2025-02-27 8:09 ` Christian Brauner
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®