linux-kernelorg-stable/kernel
Simon Schuster edd3cb05c0 copy_process: pass clone_flags as u64 across calltree
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 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>
2025-09-01 15:31:34 +02:00
..
bpf
cgroup copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
configs
debug
dma
entry
events copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
futex
gcov
irq
kcsan
livepatch
locking
module
power
printk
rcu
sched copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
time copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
trace
unwind
.gitignore
Kconfig.freezer
Kconfig.hz
Kconfig.kexec
Kconfig.locks
Kconfig.preempt
Makefile
acct.c
async.c
audit.c
audit.h
audit_fsnotify.c
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c
backtracetest.c
bounds.c
capability.c
cfi.c
compat.c
configs.c
context_tracking.c
cpu.c
cpu_pm.c
crash_core.c
crash_dump_dm_crypt.c
crash_reserve.c
cred.c copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
delayacct.c
dma.c
elfcorehdr.c
exec_domain.c
exit.c
exit.h
extable.c
fail_function.c
fork.c copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
freezer.c
gen_kheaders.sh
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kallsyms_internal.h
kallsyms_selftest.c
kallsyms_selftest.h
kcmp.c
kcov.c
kexec.c
kexec_core.c
kexec_elf.c
kexec_file.c
kexec_handover.c
kexec_internal.h
kheaders.c
kprobes.c
kstack_erase.c
ksyms_common.c
ksysfs.c
kthread.c
latencytop.c
module_signature.c
notifier.c
nsproxy.c copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
padata.c
panic.c
params.c
pid.c
pid_namespace.c copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
pid_sysctl.h
profile.c
ptrace.c
range.c
reboot.c
regset.c
relay.c
resource.c
resource_kunit.c
rseq.c
scftorture.c
scs.c
seccomp.c
signal.c
smp.c
smpboot.c
smpboot.h
softirq.c
stacktrace.c
static_call.c
static_call_inline.c
stop_machine.c
sys.c
sys_ni.c
sysctl-test.c
sysctl.c
task_work.c
taskstats.c
torture.c
tracepoint.c
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c
up.c
user-return-notifier.c
user.c
user_namespace.c
utsname.c copy_process: pass clone_flags as u64 across calltree 2025-09-01 15:31:34 +02:00
utsname_sysctl.c
vhost_task.c
vmcore_info.c
watch_queue.c
watchdog.c
watchdog_buddy.c
watchdog_perf.c
workqueue.c
workqueue_internal.h