android_kernel_xiaomi_sm8450/arch/m68k
Finn Thain cdb20b703e 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-17 15:07:44 +02:00
..
68000 m68k: Check syscall_trace_enter() return code 2023-03-11 16:39:50 +01:00
amiga m68k: amiga: Turn off Warp1260 interrupts during boot 2024-08-19 05:40:57 +02:00
apollo mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
atari m68k: atari: Fix TT bootup freeze / unexpected (SCU) interrupt messages 2024-08-19 05:40:43 +02:00
bvme6000 mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
coldfire m68k: Check syscall_trace_enter() return code 2023-03-11 16:39:50 +01:00
configs ide/macide: Convert Mac IDE driver to platform driver 2020-09-28 10:48:17 +02:00
emu m68k: emu: Fix invalid free in nfeth_cleanup() 2021-09-15 09:50:27 +02:00
fpsp040 m68k: Fix invalid .section syntax 2023-09-19 12:20:04 +02:00
hp300 treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
ifpsp060 m68k: Fix invalid .section syntax 2023-09-19 12:20:04 +02:00
include m68k: cmpxchg: Fix return value for default case in __arch_xchg() 2024-08-19 05:40:43 +02:00
kernel m68k: Fix kernel_clone_args.flags in m68k_clone() 2024-10-17 15:07:44 +02:00
lib m68k: get rid of zeroing destination on error in csum_and_copy_from_user() 2020-08-20 15:45:17 -04:00
mac m68k: mac: Fix reboot hang on Mac IIci 2024-06-16 13:32:08 +02:00
math-emu treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 74 2019-05-24 17:36:47 +02:00
mm exit: Add and use make_task_dead. 2023-02-01 08:23:19 +01:00
mvme16x m68k: mvme147,mvme16x: Don't wipe PCC timer config bits 2021-05-14 09:50:14 +02:00
mvme147 m68k: mvme147,mvme16x: Don't wipe PCC timer config bits 2021-05-14 09:50:14 +02:00
q40 mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
sun3 m68k: sun3: Descend to prom from arch/m68k/sun3 2020-07-13 11:39:12 +02:00
sun3x mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
tools/amiga m68k: tools: Replace zero-length array with flexible-array member 2020-05-25 10:55:56 +02:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
Kbuild m68k: sun3: Descend to prom from arch/m68k/sun3 2020-07-13 11:39:12 +02:00
Kconfig m68k/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:57:36 +02:00
Kconfig.bus Revert "m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch" 2022-07-29 17:19:09 +02:00
Kconfig.cpu m68k: math-emu: Fix dependencies of math emulation support 2022-06-09 10:21:09 +02:00
Kconfig.debug m68k: Fix Kconfig indentation 2020-03-09 11:12:19 +01:00
Kconfig.devices m68k: /proc/hardware should depend on PROC_FS 2023-03-11 16:39:27 +01:00
Kconfig.machine m68knommu: fix undefined reference to `_init_sp' 2022-06-14 18:32:38 +02:00
Makefile kbuild: preprocess module linker script 2020-09-25 00:36:41 +09:00