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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H4c8_GdnCdHfX_bVQ+rrGRtNua1r2MR0n5rXgXfgte0Sw@mail.gmail.com>
Date: Mon, 3 Nov 2025 17:38:49 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Thomas Weißschuh <linux@...ssschuh.net>
Cc: WANG Xuerui <kernel@...0n.name>, Jiaxun Yang <jiaxun.yang@...goat.com>, 
	loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] LoongArch: ptrace: Use UAPI types in UAPI header

On Mon, Nov 3, 2025 at 5:27 PM Thomas Weißschuh <linux@...ssschuh.net> wrote:
>
> Hi Huacai,
>
> On 2025-11-03 17:12:58+0800, Huacai Chen wrote:
> > On Wed, Oct 29, 2025 at 11:20 PM Thomas Weißschuh <linux@...ssschuh.net> wrote:
> > >
> > > The kernel UAPI headers already contain fixed-width integer types,
> > > there is no need to rely on libc types. There may not be a libc
> > > available or it may not provide <stdint.h>, like for example on nolibc.
> > >
> > > This also aligns the header with the rest of the LoongArch UAPI headers.
>
> > Thank you for your patch, but could you please tell me some history
> > and user guide about the three styles: u64, __u64 and unint64_t?
>
> uint64_t -> userspace type, should not be used within the kernel
>             can technically be used in UAPI it will be somewhat
>             nonstandard and introduce a dependency on libc with no
>             upsides.
But a simple grep shows there are many uses of uint64_t in the kernel
code, are they all wrong?

Huacai

>
> u64      -> kernel-internal type, used for regular kernel code
>             defined in include/linux/types.h
>
> __u64    -> UAPI type usable from both kernel and userspace code
>             defined in include/uapi/linux/types.
>
> As a note: When applying the patch I want to clarify the commit message
> a bit, as nolibc indeed has a stdint.h header. The real breakage comes
> from a validation step we perform which does not add the libc include
> directory to the include path.
>
>
> Thomas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ