Skip to content

Commit 76cea30

Browse files
committed
Merge patch series "nios2: Add architecture support for clone3"
Simon Schuster <schuster.simon@siemens-energy.com> says: This series adds support for the clone3 system call to the nios2 architecture. This addresses the build-time warning "warning: clone3() entry point is missing, please fix" introduced in 505d66d ("clone3: drop __ARCH_WANT_SYS_CLONE3 macro"). The implementation passes the relevant clone3 tests of kselftest when applied on top of next-20250815: ./run_kselftest.sh TAP version 13 1..4 # selftests: clone3: clone3 ok 1 selftests: clone3: clone3 # selftests: clone3: clone3_clear_sighand ok 2 selftests: clone3: clone3_clear_sighand # selftests: clone3: clone3_set_tid ok 3 selftests: clone3: clone3_set_tid # selftests: clone3: clone3_cap_checkpoint_restore ok 4 selftests: clone3: clone3_cap_checkpoint_restore The series also includes a small patch to kernel/fork.c that ensures that clone_flags are passed correctly on architectures where unsigned long is insufficient to store the u64 clone_flags. It is marked as a fix for stable backporting. As requested, in v2, this series now further tries to correct this type error throughout the whole code base. Thus, it now touches a larger number of subsystems and all architectures. Therefore, another test was performed for ARCH=x86_64 (as a representative for 64-bit architectures). Here, the series builds cleanly without warnings on defconfig with CONFIG_SECURITY_APPARMOR=y and CONFIG_SECURITY_TOMOYO=y (to compile-check the LSM-related changes). The build further successfully passes testing/selftests/clone3 (with the patch from 20241105062948.1037011-1-zhouyuhang1010@163.com to prepare clone3_cap_checkpoint_restore for compatibility with the newer libcap version on my system). * patches from https://lore.kernel.org/20250901-nios2-implement-clone3-v2-0-53fcf5577d57@siemens-energy.com: nios2: implement architecture-specific portion of sys_clone3 arch: copy_thread: pass clone_flags as u64 copy_process: pass clone_flags as u64 across calltree copy_sighand: Handle architectures where sizeof(unsigned long) < sizeof(u64) Link: https://lore.kernel.org/20250901-nios2-implement-clone3-v2-0-53fcf5577d57@siemens-energy.com Signed-off-by: Christian Brauner <brauner@kernel.org>
2 parents 8f5ae30 + c6ac444 commit 76cea30

68 files changed

Lines changed: 95 additions & 89 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

arch/alpha/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ flush_thread(void)
231231
*/
232232
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
233233
{
234-
unsigned long clone_flags = args->flags;
234+
u64 clone_flags = args->flags;
235235
unsigned long usp = args->stack;
236236
unsigned long tls = args->tls;
237237
extern void ret_from_fork(void);

arch/arc/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ asmlinkage void ret_from_fork(void);
166166
*/
167167
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
168168
{
169-
unsigned long clone_flags = args->flags;
169+
u64 clone_flags = args->flags;
170170
unsigned long usp = args->stack;
171171
unsigned long tls = args->tls;
172172
struct pt_regs *c_regs; /* child's pt_regs */

arch/arm/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
234234

235235
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
236236
{
237-
unsigned long clone_flags = args->flags;
237+
u64 clone_flags = args->flags;
238238
unsigned long stack_start = args->stack;
239239
unsigned long tls = args->tls;
240240
struct thread_info *thread = task_thread_info(p);

arch/arm64/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ asmlinkage void ret_from_fork(void) asm("ret_from_fork");
409409

410410
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
411411
{
412-
unsigned long clone_flags = args->flags;
412+
u64 clone_flags = args->flags;
413413
unsigned long stack_start = args->stack;
414414
unsigned long tls = args->tls;
415415
struct pt_regs *childregs = task_pt_regs(p);

arch/csky/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void flush_thread(void){}
3232

3333
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
3434
{
35-
unsigned long clone_flags = args->flags;
35+
u64 clone_flags = args->flags;
3636
unsigned long usp = args->stack;
3737
unsigned long tls = args->tls;
3838
struct switch_stack *childstack;

arch/hexagon/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void arch_cpu_idle(void)
5252
*/
5353
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
5454
{
55-
unsigned long clone_flags = args->flags;
55+
u64 clone_flags = args->flags;
5656
unsigned long usp = args->stack;
5757
unsigned long tls = args->tls;
5858
struct thread_info *ti = task_thread_info(p);

arch/loongarch/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
167167
unsigned long childksp;
168168
unsigned long tls = args->tls;
169169
unsigned long usp = args->stack;
170-
unsigned long clone_flags = args->flags;
170+
u64 clone_flags = args->flags;
171171
struct pt_regs *childregs, *regs = current_pt_regs();
172172

173173
childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE;

arch/m68k/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ asmlinkage int m68k_clone3(struct pt_regs *regs)
141141

142142
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
143143
{
144-
unsigned long clone_flags = args->flags;
144+
u64 clone_flags = args->flags;
145145
unsigned long usp = args->stack;
146146
unsigned long tls = args->tls;
147147
struct fork_frame {

arch/microblaze/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void flush_thread(void)
5454

5555
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
5656
{
57-
unsigned long clone_flags = args->flags;
57+
u64 clone_flags = args->flags;
5858
unsigned long usp = args->stack;
5959
unsigned long tls = args->tls;
6060
struct pt_regs *childregs = task_pt_regs(p);

arch/mips/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
107107
*/
108108
int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
109109
{
110-
unsigned long clone_flags = args->flags;
110+
u64 clone_flags = args->flags;
111111
unsigned long usp = args->stack;
112112
unsigned long tls = args->tls;
113113
struct thread_info *ti = task_thread_info(p);

0 commit comments

Comments
 (0)