OpenCloudOS-Kernel/arch/m68k
Finn Thain 886ea81de4 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: 6aabc1facd ("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-10-04 16:29:05 +02:00
..
68000 m68knommu: updates and fixes for v6.3 2023-02-27 09:31:02 -08:00
amiga m68k: amiga: Turn off Warp1260 interrupts during boot 2024-08-03 08:54:17 +02:00
apollo m68k: Add asm/config.h 2022-02-21 12:00:20 +01:00
atari m68k: atari: Fix TT bootup freeze / unexpected (SCU) interrupt messages 2024-08-03 08:53:32 +02:00
bvme6000 for-5.18/block-2022-03-18 2022-03-21 16:48:55 -07:00
coldfire m68k: coldfire: dma_timer: ERROR: "foo __init bar" should be "foo __init bar" 2023-08-21 08:45:36 +10:00
configs - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
emu tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
fpsp040 m68k: Fix invalid .section syntax 2023-07-24 14:50:02 +02:00
hp300 m68k: removed unused "mach_get_ss" 2022-05-25 00:04:11 +10:00
ifpsp060 m68k: Fix invalid .section syntax 2023-07-24 14:50:02 +02:00
include m68k: cmpxchg: Fix return value for default case in __arch_xchg() 2024-08-03 08:53:34 +02:00
kernel m68k: Fix kernel_clone_args.flags in m68k_clone() 2024-10-04 16:29:05 +02:00
lib m68k: Replace #include <asm/export.h> with #include <linux/export.h> 2023-08-21 13:27:43 +02:00
mac m68k: mac: Fix reboot hang on Mac IIci 2024-06-12 11:11:51 +02:00
math-emu m68k: math-emu: Fix typos in comments 2022-05-09 13:13:59 +02:00
mm m68k: implement the new page table range API 2023-08-24 16:20:21 -07:00
mvme16x for-5.18/block-2022-03-18 2022-03-21 16:48:55 -07:00
mvme147 for-5.18/block-2022-03-18 2022-03-21 16:48:55 -07:00
q40 m68k: q40: Do not initialise statics to 0 2023-01-30 16:39:43 +01:00
sun3 m68k: Pass a pointer to virt_to_pfn() virt_to_page() 2023-05-29 11:27:07 +02:00
sun3x m68k: Pass a pointer to virt_to_pfn() virt_to_page() 2023-05-29 11:27:07 +02:00
tools/amiga m68k: tools: Replace zero-length array with flexible-array member 2020-05-25 10:55:56 +02:00
virt m68k: Rework BI_VIRT_RNG_SEED as BI_RNG_SEED 2022-09-28 22:16:44 +02:00
Kbuild m68k: Introduce a virtual m68k machine 2022-04-11 11:48:01 +02:00
Kconfig m68k/kexec: refactor for kernel/Kconfig.kexec 2023-08-18 10:18:53 -07:00
Kconfig.bus m68k: coldfire: drop ISA_DMA_API support 2022-05-16 13:18:30 +10:00
Kconfig.cpu - Nick Piggin's "shoot lazy tlbs" series, to improve the peformance of 2023-04-27 19:42:02 -07:00
Kconfig.debug m68k: Remove obsolete config NO_KERNEL_MSG 2023-03-20 15:39:14 +01:00
Kconfig.devices m68k: /proc/hardware should depend on PROC_FS 2023-02-13 11:34:49 +01:00
Kconfig.machine m68knommu: updates and fixes for v6.4 2023-04-28 16:37:54 -07:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00
install.sh kbuild: factor out the common installation code into scripts/install.sh 2022-05-11 21:45:53 +09:00