linux/arch/um
Simon Schuster e0d6fb7923 arch: copy_thread: pass clone_flags as u64
[ Upstream commit bbc46b23af ]

With the introduction of clone3 in commit 7f192e3cd3 ("fork: add
clone3") the effective bit width of clone_flags on all architectures was
increased from 32-bit to 64-bit, with a new type of u64 for the flags.
However, for most consumers of clone_flags the interface was not
changed from the previous type of unsigned long.

While this works fine as long as none of the new 64-bit flag bits
(CLONE_CLEAR_SIGHAND and CLONE_INTO_CGROUP) are evaluated, this is still
undesirable in terms of the principle of least surprise.

Thus, this commit fixes all relevant interfaces of the copy_thread
function that is called from copy_process to consistently pass
clone_flags as u64, so that no truncation to 32-bit integers occurs on
32-bit architectures.

Signed-off-by: Simon Schuster <schuster.simon@siemens-energy.com>
Link: https://lore.kernel.org/20250901-nios2-implement-clone3-v2-3-53fcf5577d57@siemens-energy.com
Fixes: c5febea095 ("fork: Pass struct kernel_clone_args into copy_thread")
Acked-by: Guo Ren (Alibaba Damo Academy) <guoren@kernel.org>
Acked-by: Andreas Larsson <andreas@gaisler.com> # sparc
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> # m68k
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-15 12:03:13 +02:00
..
configs um: Remove legacy network transport infrastructure 2025-05-05 10:26:59 +02:00
drivers um: virtio_uml: Fix use-after-free after put_device in probe 2025-09-10 14:24:16 +02:00
include Mostly cleanups, except: 2025-07-29 20:31:45 -07:00
kernel arch: copy_thread: pass clone_flags as u64 2025-10-15 12:03:13 +02:00
os-Linux um: Fix FD copy size in os_rcv_fd_msg() 2025-09-10 14:24:19 +02:00
scripts um: prevent user code in modules 2023-04-20 23:06:38 +02:00
.gitignore um: gitignore: Add kernel/capflags.c 2021-12-21 21:22:43 +01:00
Kbuild um: use obj-y to descend into arch/um/*/ 2023-08-26 22:41:34 +02:00
Kconfig um: Avoid redefining ARCH_HAS_CACHE_LINE_SIZE 2025-07-11 08:49:18 +02:00
Kconfig.debug um: Disable CONFIG_GCOV with MODULES 2021-04-15 23:10:33 +02:00
Makefile require gcc-8 and binutils-2.30 2025-05-31 08:16:52 -07:00
Makefile-os-Linux x86, um: get rid of arch/um/os symlink 2008-10-22 22:55:22 -07:00
Makefile-skas um: fix stub exe build with CONFIG_GCOV 2024-10-26 16:06:10 +02:00