]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
copy_process: pass clone_flags as u64 across calltree
authorSimon Schuster <schuster.simon@siemens-energy.com>
Mon, 1 Sep 2025 13:09:51 +0000 (15:09 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 1 Sep 2025 13:31:34 +0000 (15:31 +0200)
commitedd3cb05c00a040dc72bed20b14b5ba865188bce
tree4af926aeb6d32e2d5aafc3c3f71678c766eb6fd4
parent04ff48239f46e8b493571e260bd0e6c3a6400371
copy_process: pass clone_flags as u64 across calltree

With the introduction of clone3 in commit 7f192e3cd316 ("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 callees to
sys_clone3/copy_process (excluding the architecture-specific
copy_thread) 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-2-53fcf5577d57@siemens-energy.com
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
38 files changed:
block/blk-ioc.c
fs/namespace.c
include/linux/cgroup.h
include/linux/cred.h
include/linux/iocontext.h
include/linux/ipc_namespace.h
include/linux/lsm_hook_defs.h
include/linux/mnt_namespace.h
include/linux/nsproxy.h
include/linux/pid_namespace.h
include/linux/rseq.h
include/linux/sched/task.h
include/linux/security.h
include/linux/sem.h
include/linux/time_namespace.h
include/linux/uprobes.h
include/linux/user_events.h
include/linux/utsname.h
include/net/net_namespace.h
include/trace/events/task.h
ipc/namespace.c
ipc/sem.c
kernel/cgroup/namespace.c
kernel/cred.c
kernel/events/uprobes.c
kernel/fork.c
kernel/nsproxy.c
kernel/pid_namespace.c
kernel/sched/core.c
kernel/sched/fair.c
kernel/sched/sched.h
kernel/time/namespace.c
kernel/utsname.c
net/core/net_namespace.c
security/apparmor/lsm.c
security/security.c
security/selinux/hooks.c
security/tomoyo/tomoyo.c