[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdXot=WG9xca7XgiWtZmXhTJ_8oPkZoNifxUvnu21baJzg@mail.gmail.com>
Date: Mon, 26 Aug 2024 09:40:48 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Finn Thain <fthain@...ux-m68k.org>
Cc: Christian Brauner <brauner@...nel.org>, Greg Ungerer <gerg@...ux-m68k.org>,
Stan Johnson <userm57@...oo.com>, linux-m68k@...ts.linux-m68k.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] m68k: Fix kernel_clone_args.flags in m68k_clone()
On Sun, Aug 11, 2024 at 2:13 AM Finn Thain <fthain@...ux-m68k.org> wrote:
> Stan Johnson recently reported a failure from the 'dump' command:
>
> DUMP: Date of this level 0 dump: Fri Aug 9 23:37:15 2024
> DUMP: Dumping /dev/sda (an unlisted file system) to /dev/null
> DUMP: Label: none
> DUMP: Writing 10 Kilobyte records
> DUMP: mapping (Pass I) [regular files]
> DUMP: mapping (Pass II) [directories]
> DUMP: estimated 3595695 blocks.
> DUMP: Context save fork fails in parent 671
>
> The dump program uses the clone syscall with the CLONE_IO flag, that is,
> flags == 0x80000000. When that value is promoted from long int to u64 by
> m68k_clone(), it undergoes sign-extension. The new value includes
> CLONE_INTO_CGROUP so the validation in cgroup_css_set_fork() fails and
> the syscall returns -EBADF. Avoid sign-extension by casting to u32.
>
> Cc: Stan Johnson <userm57@...oo.com>
> Reported-by: Stan Johnson <userm57@...oo.com>
> Closes: https://lists.debian.org/debian-68k/2024/08/msg00000.html
> Fixes: 6aabc1facdb2 ("m68k: Implement copy_thread_tls()")
> Signed-off-by: Finn Thain <fthain@...ux-m68k.org>
> ---
> Changed since v1:
> - Cast to u32 instead of using lower_32_bits() as suggested by Geert.
> Changed since v2:
> - Commit log ammended with -EBADF instead of -EBADFD.
Reviewed-by: Geert Uytterhoeven <geert@...ux-m68k.org>
i.e. will queue in the m68k tree for v6.12.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists