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]
Date:   Sat, 23 Jun 2018 14:47:16 -0500
From:   Segher Boessenkool <segher@...nel.crashing.org>
To:     christophe leroy <christophe.leroy@....fr>
Cc:     Mathieu Malaterre <malat@...ian.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Yisheng Xie <xieyisheng1@...wei.com>,
        Vaibhav Jain <vaibhav@...ux.vnet.ibm.com>,
        Nicholas Piggin <npiggin@...il.com>,
        linux-kernel@...r.kernel.org, Paul Mackerras <paulus@...ba.org>,
        Breno Leitao <leitao@...ian.org>, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH] powerpc/xmon: avoid warnings about variables that might be clobbered by ‘longjmp’

On Sat, Jun 23, 2018 at 06:59:27PM +0200, christophe leroy wrote:
> 
> 
> Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit :
> >Move initialization of variables after data definitions. This silence
> >warnings treated as error with W=1:
> >
> >   arch/powerpc/xmon/xmon.c:3389:14: error: variable ‘name’ might be 
> >   clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
> >   arch/powerpc/xmon/xmon.c:3100:22: error: variable ‘tsk’ might be 
> >   clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
> 
> Is that an invalid warning ?

No, both are correct warnings.  GCC can not see which functions it only
has a declaration of can call longjmp.

> Otherwise, I'd expect one to fix the warning, not just cheat on GCC.

Yes, the patch seems to change the code in such a way that some versions
of GCC will no longer warn.  Which does not make to code any more correct.

Either restructure the code, or make the var non-automatic, or make it
volatile.


Segher

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ