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] [day] [month] [year] [list]
Message-ID: <CAAhV-H7smLd-Zn_kZZMpki6DzV+5905gSYs1EuL+ppYek4-iag@mail.gmail.com>
Date: Fri, 14 Nov 2025 12:41:40 +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

Applied, thanks.

Huacai

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.
>
> Fixes: 803b0fc5c3f2 ("LoongArch: Add process management")
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
> ---
> I'd like to take this through the nolibc tree, as this currently breaks
> the upcoming nolibc ptrace support.
> ---
>  arch/loongarch/include/uapi/asm/ptrace.h | 40 ++++++++++++++------------------
>  1 file changed, 18 insertions(+), 22 deletions(-)
>
> diff --git a/arch/loongarch/include/uapi/asm/ptrace.h b/arch/loongarch/include/uapi/asm/ptrace.h
> index aafb3cd9e943..215e0f9e8aa3 100644
> --- a/arch/loongarch/include/uapi/asm/ptrace.h
> +++ b/arch/loongarch/include/uapi/asm/ptrace.h
> @@ -10,10 +10,6 @@
>
>  #include <linux/types.h>
>
> -#ifndef __KERNEL__
> -#include <stdint.h>
> -#endif
> -
>  /*
>   * For PTRACE_{POKE,PEEK}USR. 0 - 31 are GPRs,
>   * 32 is syscall's original ARG0, 33 is PC, 34 is BADVADDR.
> @@ -41,44 +37,44 @@ struct user_pt_regs {
>  } __attribute__((aligned(8)));
>
>  struct user_fp_state {
> -       uint64_t fpr[32];
> -       uint64_t fcc;
> -       uint32_t fcsr;
> +       __u64 fpr[32];
> +       __u64 fcc;
> +       __u32 fcsr;
>  };
>
>  struct user_lsx_state {
>         /* 32 registers, 128 bits width per register. */
> -       uint64_t vregs[32*2];
> +       __u64 vregs[32*2];
>  };
>
>  struct user_lasx_state {
>         /* 32 registers, 256 bits width per register. */
> -       uint64_t vregs[32*4];
> +       __u64 vregs[32*4];
>  };
>
>  struct user_lbt_state {
> -       uint64_t scr[4];
> -       uint32_t eflags;
> -       uint32_t ftop;
> +       __u64 scr[4];
> +       __u32 eflags;
> +       __u32 ftop;
>  };
>
>  struct user_watch_state {
> -       uint64_t dbg_info;
> +       __u64 dbg_info;
>         struct {
> -               uint64_t    addr;
> -               uint64_t    mask;
> -               uint32_t    ctrl;
> -               uint32_t    pad;
> +               __u64    addr;
> +               __u64    mask;
> +               __u32    ctrl;
> +               __u32    pad;
>         } dbg_regs[8];
>  };
>
>  struct user_watch_state_v2 {
> -       uint64_t dbg_info;
> +       __u64 dbg_info;
>         struct {
> -               uint64_t    addr;
> -               uint64_t    mask;
> -               uint32_t    ctrl;
> -               uint32_t    pad;
> +               __u64    addr;
> +               __u64    mask;
> +               __u32    ctrl;
> +               __u32    pad;
>         } dbg_regs[14];
>  };
>
>
> ---
> base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
> change-id: 20251029-loongarch-uapi-ptrace-types-0c5c6756f7e0
>
> Best regards,
> --
> Thomas Weißschuh <linux@...ssschuh.net>
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ