kernel_samsung_a53x/arch/m68k
Finn Thain 1ed7b9f02f m68k: Fix kernel_clone_args.flags in m68k_clone()
[ Upstream commit 09b3d870faa7bc3e96c0978ab3cf4e96e4b15571 ]

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.

Reported-by: Stan Johnson <userm57@yahoo.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@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/3463f1e5d4e95468dc9f3368f2b78ffa7b72199b.1723335149.git.fthain@linux-m68k.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:20 +01:00
..
68000 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amiga m68k: amiga: Turn off Warp1260 interrupts during boot 2024-11-23 23:20:13 +01:00
apollo Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atari m68k: atari: Fix TT bootup freeze / unexpected (SCU) interrupt messages 2024-11-23 23:20:06 +01:00
bvme6000 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
coldfire Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
configs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
emu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fpsp040 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hp300 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ifpsp060 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
include m68k: cmpxchg: Fix return value for default case in __arch_xchg() 2024-11-23 23:20:06 +01:00
kernel m68k: Fix kernel_clone_args.flags in m68k_clone() 2024-11-23 23:21:20 +01:00
lib Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mac m68k: mac: Fix reboot hang on Mac IIci 2024-11-19 12:26:56 +01:00
math-emu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mvme16x Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mvme147 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
q40 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sun3 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sun3x Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tools/amiga Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
install.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kbuild Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.bus Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.cpu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.debug Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.devices Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.machine Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00