kernel/fork.c:3088:2: warning: clone3() entry point is missing, please fix
kernel test robot
build botHi Arnd,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: aaf724ed69264719550ec4f194d3ab17b886af9a commit: 505d66d1abfb90853e24ab6cbdf83b611473d6fc clone3: drop __ARCH_WANT_SYS_CLONE3 macro date: 12 months ago config: hexagon-randconfig-2002-20250626 (https://download.01.org/0day-ci/archive/20250628/[email protected]/config) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250628/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
In file included from kernel/fork.c:34:
In file included from include/linux/mempolicy.h:15:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:14:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
548 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
561 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from kernel/fork.c:34:
In file included from include/linux/mempolicy.h:15:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:14:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
574 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from kernel/fork.c:34:
In file included from include/linux/mempolicy.h:15:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:14:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
585 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
595 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
605 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
>> kernel/fork.c:3088:2: warning: clone3() entry point is missing, please fix [-W#warnings] 3088 | #warning clone3() entry point is missing, please fix
| ^
7 warnings generated.
vim +3088 kernel/fork.c
3068
3069 /**
3070 * sys_clone3 - create a new process with specific properties
3071 * @uargs: argument structure
3072 * @size: size of @uargs
3073 *
3074 * clone3() is the extensible successor to clone()/clone2().
3075 * It takes a struct as argument that is versioned by its size.
3076 *
3077 * Return: On success, a positive PID for the child process.
3078 * On error, a negative errno number.
3079 */
3080 SYSCALL_DEFINE2(clone3, struct clone_args __user *, uargs, size_t, size)
3081 {
3082 int err;
3083
3084 struct kernel_clone_args kargs;
3085 pid_t set_tid[MAX_PID_NS_LEVEL];
3086
3087 #ifdef __ARCH_BROKEN_SYS_CLONE3
> 3088 #warning clone3() entry point is missing, please fix
3089 return -ENOSYS;
3090 #endif
3091
3092 kargs.set_tid = set_tid;
3093
3094 err = copy_clone_args_from_user(&kargs, uargs, size);
3095 if (err)
3096 return err;
3097
3098 if (!clone3_args_valid(&kargs))
3099 return -EINVAL;
3100
3101 return kernel_clone(&kargs);
3102 }
3103
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Arnd Bergmann
maintainerQuoted 9 lines · kernel test robot
Hi Arnd,
FYI, the error/warning still remains.
date: 12 months ago config: hexagon-randconfig-2002-20250626(https://download.01.org/0day-ci/archive/20250628/[email protected]/config)
commit:505d66d1abfb90853e24ab6cbdf83b611473d6fcclone3: drop__ARCH_WANT_SYS_CLONE3macroQuoted 1 line
kernel/fork.c:3088:2: warning:clone3()entry point is missing, please fix [-W#warnings]
My patch only moved the warning about the four broken architectures (hexagon, sparc, sh, nios2) that have never implemented the clone3 syscall from commit 7f192e3cd316 ("fork: add clone3"), over six years ago.
I usually try to fix warnings when I get them, but the entire point why these still exist is that they require someone to add the syscall with the correct calling conventions for the respective architecture and make sure this actually works correctly.
I don't think any of those architecture maintainers are paying attention to the build warnings or the lkp reports, and they are clearly not trying to fix them any more, so maybe it's better to just stop testing them in lkp.
Arnd
John Paul Adrian Glaubitz
maintainerHi Arnd,
Quoted 21 lines · Arnd Bergmann
Quoted 9 lines · kernel test robot
Hi Arnd,
FYI, the error/warning still remains.
date: 12 months ago config: hexagon-randconfig-2002-20250626(https://download.01.org/0day-ci/archive/20250628/[email protected]/config)
commit:505d66d1abfb90853e24ab6cbdf83b611473d6fcclone3: drop__ARCH_WANT_SYS_CLONE3macroQuoted 1 line
kernel/fork.c:3088:2: warning:clone3()entry point is missing, please fix [-W#warnings]My patch only moved the warning about the four broken architectures (hexagon, sparc, sh, nios2) that have never implemented the clone3 syscall from commit
7f192e3cd316("fork: add clone3"), over six years ago.I usually try to fix warnings when I get them, but the entire point why these still exist is that they require someone to add the syscall with the correct calling conventions for the respective architecture and make sure this actually works correctly.
Quoted 4 lines
I don't think any of those architecture maintainers are paying attention to the build warnings or the lkp reports, and they are clearly not trying to fix them any more, so maybe it's better to just stop testing them in lkp.
I have seen that warning about clone3() missing but I was not aware that it's an urgent issue to address. Do you have any suggestion on how to implement that syscall?
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Arnd Bergmann
maintainerQuoted 11 lines · John Paul Adrian Glaubitz
Quoted 6 lines · Arnd Bergmann
On Sat, Jun 28, 2025, at 21:59, kernel test robot wrote:
I don't think any of those architecture maintainers are paying attention to the build warnings or the lkp reports, and they are clearly not trying to fix them any more, so maybe it's better to just stop testing them in lkp.
I have seen that warning about
clone3()missing but I was not aware that it's an urgent issue to address. Do you have any suggestion on how to implement that syscall?
Some architectures have custom calling conventions for the fork/vfork/clone/clone3 syscalls, e.g. to handle copying all the registers correctly when the normal syscall entry doesn't do that, or to handle the changing stack correctly.
I see that both sparc and hexagon have a custom clone() syscall, so they likely need a custom clone3() as well, while sh and nios2 probably don't.
All four would need a custom assembler implementation in userspace for each libc, in order to test the userspace calling the clone3() function. For testing the kernel entry point itself, see Christian's original test case[1].
Arnd
John Paul Adrian Glaubitz
maintainerHi Arnd,
Quoted 5 lines · Arnd Bergmann
Some architectures have custom calling conventions for the fork/vfork/clone/clone3 syscalls, e.g. to handle copying all the registers correctly when the normal syscall entry doesn't do that, or to handle the changing stack correctly.
Quoted 8 lines
I see that both sparc and hexagon have a custom
clone()syscall, so they likely need a customclone3()as well, while sh and nios2 probably don't.All four would need a custom assembler implementation in userspace for each libc, in order to test the userspace calling the
clone3()function. For testing the kernel entry point itself, see Christian's original test case[1].
Thanks for the explanation. So, I guess as long as a proposed implementation of clone3() on sh would pass Arnd's test program, it should be good for merging?
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Arnd Bergmann
maintainerQuoted 10 lines · John Paul Adrian Glaubitz
Quoted 9 lines · Arnd Bergmann
Some architectures have custom calling conventions for the fork/vfork/clone/clone3 syscalls, e.g. to handle copying all the registers correctly when the normal syscall entry doesn't do that, or to handle the changing stack correctly.
I see that both sparc and hexagon have a custom
clone()syscall, so they likely need a customclone3()as well, while sh and nios2 probably don't.
Quoted 7 lines
Quoted 4 lines
All four would need a custom assembler implementation in userspace for each libc, in order to test the userspace calling the
clone3()function. For testing the kernel entry point itself, see Christian's original test case[1].Thanks for the explanation. So, I guess as long as a proposed implementation of
clone3()on sh would pass Arnd's test program, it should be good for merging?
Yes, Christian's test program should be enough for merging into the kernel, though I would recommend also coming up with the matching glibc patch, in order to ensure it can actually be regression tested automatically, and to use the new features provided by glibc clone3().
Right now glibc assumes that clone3() is available on linux-5.3 or higher and uses it to implement the normal clone() in that case, except where the implementation is missing.
I see that at alpha, csky, parisc and microblaze have a kernel implementation in modern Linux versions, but are missing the glibc wrapper for it, as the kernel side was done later without the glibc version. sparc and sh are the only ones with a glibc port that are missing both the kernel and userspace side, while hexagon and nios2 are not currently part of mainline glibc.
Arnd
Quoted 28 lines · Arnd Bergmann
Quoted 10 lines · John Paul Adrian Glaubitz
Quoted 9 lines · Arnd Bergmann
Some architectures have custom calling conventions for the fork/vfork/clone/clone3 syscalls, e.g. to handle copying all the registers correctly when the normal syscall entry doesn't do that, or to handle the changing stack correctly.
I see that both sparc and hexagon have a custom
clone()syscall, so they likely need a customclone3()as well, while sh and nios2 probably don't.Quoted 7 lines
Quoted 4 lines
All four would need a custom assembler implementation in userspace for each libc, in order to test the userspace calling the
clone3()function. For testing the kernel entry point itself, see Christian's original test case[1].Thanks for the explanation. So, I guess as long as a proposed implementation of
clone3()on sh would pass Arnd's test program, it should be good for merging?Yes, Christian's test program should be enough for merging into the kernel, though I would recommend also coming up with the matching glibc patch, in order to ensure it can actually be regression tested automatically, and to use the new features provided by glibc
clone3().Right now glibc assumes that
clone3()is available on linux-5.3 or higher and uses it to implement the normalclone()in that case, except where the implementation is missing.
Quoted 6 lines
I see that at alpha, csky, parisc and microblaze have a kernel implementation in modern Linux versions, but are missing the glibc wrapper for it, as the kernel side was done later without the glibc version. sparc and sh are the only ones with a glibc port that are missing both the kernel and userspace side, while hexagon and nios2 are not currently part of mainline glibc.
Thanks for all the input Arnd! All this will be very good to have at hand when looking into implementing and testing it!
I was not aware that clone3 was used under the hood in glibc. Given that clone3 is not exposed by glibc to the outside I did not realize that glibc would actually use it, so it never got high enough up in the priority even though I have been well aware of it being missing.
Stopping the testing of these architectures in lkp because of the missing clone3 would be unfortunate and a bit excessive in my view. That testing is and has been very useful!
Cheers,
Andreas
Quoted 16 lines · Arnd Bergmann
Quoted 15 lines · John Paul Adrian Glaubitz
Quoted 13 lines · Arnd Bergmann
Some architectures have custom calling conventions for the fork/vfork/clone/clone3 syscalls, e.g. to handle copying all the registers correctly when the normal syscall entry doesn't do that, or to handle the changing stack correctly.
I see that both sparc and hexagon have a custom
clone()syscall, so they likely need a customclone3()as well, while sh and nios2 probably don't.All four would need a custom assembler implementation in userspace for each libc, in order to test the userspace calling the
clone3()function. For testing the kernel entry point itself, see Christian's original test case[1].
Quoted 7 lines
Quoted 2 lines
Thanks for the explanation. So, I guess as long as a proposed implementation of
clone3()on sh would pass Arnd's test program, it should be good for merging?Yes, Christian's test program should be enough for merging into the kernel, though I would recommend also coming up with the matching glibc patch, in order to ensure it can actually be regression tested automatically, and to use the new features provided by glibc
clone3().
Note that we do have clone3() selftests in the kernel:
Quoted 1 line
ls -al
tools/testing/selftests/clone3/
total 48
drwxrwxr-x 2 brauner brauner 175 Jun 4 22:45 .
drwxrwxr-x 118 brauner brauner 4096 Jun 16 10:10 .. -rw-rw-r-- 1 brauner brauner 7377 Apr 15 10:47 clone3.c -rw-rw-r-- 1 brauner brauner 3939 May 13 12:23 clone3_cap_checkpoint_restore.c -rw-rw-r-- 1 brauner brauner 2512 Apr 15 10:47 clone3_clear_sighand.c -rw-rw-r-- 1 brauner brauner 1437 Jun 4 22:45 clone3_selftests.h -rw-rw-r-- 1 brauner brauner 10738 Apr 15 10:47 clone3_set_tid.c -rw-rw-r-- 1 brauner brauner 113 Apr 11 15:36 .gitignore -rw-rw-r-- 1 brauner brauner 206 Apr 15 10:47 Makefile
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · kernel test robot
Hi Arnd,
FYI, the error/warning still remains.
date: 12 months ago config: hexagon-randconfig-2002-20250626(https://download.01.org/0day-ci/archive/20250628/[email protected]/config)
commit:505d66d1abfb90853e24ab6cbdf83b611473d6fcclone3: drop__ARCH_WANT_SYS_CLONE3macro
Quoted 6 lines
Quoted 1 line
Quoted 1 line
kernel/fork.c:3088:2: warning:clone3()entry point is missing, please fix [-W#warnings]My patch only moved the warning about the four broken architectures (hexagon, sparc, sh, nios2) that have never implemented the clone3 syscall from commit
7f192e3cd316("fork: add clone3"), over six years ago.
Sorry for the false positive, I will configure the bot to avoid sending this again.
Quoted 10 lines
I usually try to fix warnings when I get them, but the entire point why these still exist is that they require someone to add the syscall with the correct calling conventions for the respective architecture and make sure this actually works correctly.
I don't think any of those architecture maintainers are paying attention to the build warnings or the lkp reports, and they are clearly not trying to fix them any more, so maybe it's better to just stop testing them in lkp.
Thanks for the comments, we will consider to adjust the priority for the related archs. Also welcome more inputs for how to test and report out issues of these archs.
Quoted 3 lines
Arnd