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]
Message-ID: <b41b244e-78b8-c85f-9122-427ad04cccf8@c-s.fr>
Date:   Sat, 23 Jun 2018 18:59:27 +0200
From:   christophe leroy <christophe.leroy@....fr>
To:     Mathieu Malaterre <malat@...ian.org>,
        Michael Ellerman <mpe@...erman.id.au>
Cc:     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’



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 ?

If so, please explain in the commit log.

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

Christophe


> 
> Signed-off-by: Mathieu Malaterre <malat@...ian.org>
> ---
>   arch/powerpc/xmon/xmon.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index 47166ad2a669..982848c784ff 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -3097,10 +3097,11 @@ static void show_pte(unsigned long addr)
>   static void show_tasks(void)
>   {
>   	unsigned long tskv;
> -	struct task_struct *tsk = NULL;
> +	struct task_struct *tsk;
>   
>   	printf("     task_struct     ->thread.ksp    PID   PPID S  P CMD\n");
>   
> +	tsk = NULL;
>   	if (scanhex(&tskv))
>   		tsk = (struct task_struct *)tskv;
>   
> @@ -3386,10 +3387,11 @@ static void xmon_print_symbol(unsigned long address, const char *mid,
>   			      const char *after)
>   {
>   	char *modname;
> -	const char *name = NULL;
> +	const char *name;
>   	unsigned long offset, size;
>   
>   	printf(REG, address);
> +	name = NULL;
>   	if (setjmp(bus_error_jmp) == 0) {
>   		catch_memory_errors = 1;
>   		sync();
> 

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ