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]
Date:   Wed, 9 Aug 2023 13:17:02 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Arnd Bergmann <arnd@...nel.org>,
        Michael Ellerman <mpe@...erman.id.au>
CC:     Arnd Bergmann <arnd@...db.de>, Nicholas Piggin <npiggin@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        Maninder Singh <maninder1.s@...sung.com>,
        Hugh Dickins <hughd@...gle.com>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        Nathan Lynch <nathanl@...ux.ibm.com>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] powerpc: mark more local variables as volatile



Le 09/08/2023 à 15:10, Arnd Bergmann a écrit :
> From: Arnd Bergmann <arnd@...db.de>
> 
> A while ago I created a2305e3de8193 ("powerpc: mark local variables
> around longjmp as volatile") in order to allow building powerpc with
> -Wextra enabled on gcc-11.

Should this be explained in 
https://docs.kernel.org/process/volatile-considered-harmful.html ?

Christophe


> 
> I tried this again with gcc-13 and found two more of the same issues,
> presumably based on slightly different optimization paths being taken
> here:
> 
> arch/powerpc/xmon/xmon.c:3306:27: error: variable 'mm' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
> arch/powerpc/kexec/crash.c:353:22: error: variable 'i' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
> 
> I checked a bunch of randconfigs and found only these two, so just
> address them the same way as the others.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>   arch/powerpc/kexec/crash.c | 2 +-
>   arch/powerpc/xmon/xmon.c   | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
> index 252724ed666a3..ef5c2d25ec397 100644
> --- a/arch/powerpc/kexec/crash.c
> +++ b/arch/powerpc/kexec/crash.c
> @@ -350,7 +350,7 @@ EXPORT_SYMBOL(crash_shutdown_unregister);
>   
>   void default_machine_crash_shutdown(struct pt_regs *regs)
>   {
> -	unsigned int i;
> +	volatile unsigned int i;
>   	int (*old_handler)(struct pt_regs *regs);
>   
>   	if (TRAP(regs) == INTERRUPT_SYSTEM_RESET)
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index 3b6f524c790e3..9e12b75850d75 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -3303,7 +3303,7 @@ static void show_pte(unsigned long addr)
>   {
>   	unsigned long tskv = 0;
>   	struct task_struct *volatile tsk = NULL;
> -	struct mm_struct *mm;
> +	struct mm_struct *volatile mm;
>   	pgd_t *pgdp;
>   	p4d_t *p4dp;
>   	pud_t *pudp;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ