lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dfd0a228-940d-4c30-b07e-9f3910e3aeaf@gaisler.com>
Date: Mon, 30 Jun 2025 17:24:04 +0200
From: Andreas Larsson <andreas@...sler.com>
To: Arnd Bergmann <arnd@...db.de>,
 John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
 kernel test robot <lkp@...el.com>, Philip Li <philip.li@...el.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
 linux-kernel@...r.kernel.org, linux-hexagon@...r.kernel.org,
 sparclinux@...r.kernel.org, linux-sh@...r.kernel.org,
 Dinh Nguyen <dinguyen@...nel.org>,
 Simon Schuster <schuster.simon+binutils@...mens-energy.com>,
 Linux-Arch <linux-arch@...r.kernel.org>,
 Christian Brauner <brauner@...nel.org>
Subject: Re: kernel/fork.c:3088:2: warning: clone3() entry point is missing,
 please fix

On 2025-06-30 14:07, Arnd Bergmann wrote:
> On Mon, Jun 30, 2025, at 12:45, John Paul Adrian Glaubitz wrote:
>> On Mon, 2025-06-30 at 12:02 +0200, Arnd Bergmann wrote:
>>> 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].
>>
>> 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.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ