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-H6kxy9NaWXqq1QLfobVvVz9-VMybHC6M+0V-sE3MY9SRA@mail.gmail.com>
Date: Sun, 27 Apr 2025 20:32:05 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Oleg Nesterov <oleg@...hat.com>, Thomas Bogendoerfer <tsbogend@...ha.franken.de>, 
	"Maciej W. Rozycki" <macro@...am.me.uk>, linux-mips@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] MIPS: Fix MAX_REG_OFFSET

Hi, Thorsten,

On Sun, Apr 27, 2025 at 7:35 PM Thorsten Blum <thorsten.blum@...ux.dev> wrote:
>
> Fix MAX_REG_OFFSET to point to the last register in 'pt_regs' and not to
> the marker itself, which could allow regs_get_register() to return an
> invalid offset.
>
> Fixes: 40e084a506eb ("MIPS: Add uprobes support.")
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
> Compile-tested only.
>
> Changes in v2:
> - Fix MAX_REG_OFFSET as suggested by Maciej (thanks!)
> - Link to v1: https://lore.kernel.org/lkml/20250411090032.7844-1-thorsten.blum@linux.dev/
>
> Changes in v3:
> - Keep the marker and avoid using #ifdef by adjusting MAX_REG_OFFSET as
>   suggested by Thomas and Maciej
> - Link to v2: https://lore.kernel.org/lkml/20250417174712.69292-2-thorsten.blum@linux.dev/
> ---
>  arch/mips/include/asm/ptrace.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
> index 85fa9962266a..ef72c46b5568 100644
> --- a/arch/mips/include/asm/ptrace.h
> +++ b/arch/mips/include/asm/ptrace.h
> @@ -65,7 +65,8 @@ static inline void instruction_pointer_set(struct pt_regs *regs,
>
>  /* Query offset/name of register from its name/offset */
>  extern int regs_query_register_offset(const char *name);
> -#define MAX_REG_OFFSET (offsetof(struct pt_regs, __last))
> +#define MAX_REG_OFFSET \
> +       (offsetof(struct pt_regs, __last) - sizeof(unsigned long))
There is no 80 columns limit now, so no new line needed here.

Huacai

>
>  /**
>   * regs_get_register() - get register value from its offset
> --
> 2.49.0
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ