linux/arch/xtensa
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
..
boot xtensa: migrate to the generic rule for built-in DTB 2025-03-17 06:48:32 +03:00
configs Xtensa updates for v6.16 2025-06-03 09:05:01 -07:00
include Xtensa updates for v6.17 2025-08-09 07:35:03 +03:00
kernel arch: copy_thread: pass clone_flags as u64 2025-10-15 12:03:13 +02:00
lib xtensa: Use PCI_HEADER_TYPE_MFD instead of literal 2023-11-29 02:07:52 -08:00
mm arch, mm: make releasing of memory to page allocator more explicit 2025-03-17 22:06:53 -07:00
platforms treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
variants xtensa: add test_kc705_be variant 2018-08-20 12:34:45 -07:00
Kbuild xtensa: migrate to the generic rule for built-in DTB 2025-03-17 06:48:32 +03:00
Kconfig xtensa: migrate to the generic rule for built-in DTB 2025-03-17 06:48:32 +03:00
Kconfig.debug xtensa: dump userspace code around the exception PC 2023-06-24 06:34:27 -07:00
Makefile xtensa: don't produce FDPIC output with fdpic toolchain 2024-01-11 18:58:47 -08:00