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: <82eec792-b71f-17cc-d905-368fd5ca62f2@csgroup.eu>
Date:   Wed, 10 Aug 2022 08:28:59 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Sathvika Vasireddy <sv@...ux.ibm.com>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
CC:     "jpoimboe@...hat.com" <jpoimboe@...hat.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "aik@...abs.ru" <aik@...abs.ru>,
        "mpe@...erman.id.au" <mpe@...erman.id.au>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "mbenes@...e.cz" <mbenes@...e.cz>,
        "npiggin@...il.com" <npiggin@...il.com>,
        "chenzhongjin@...wei.com" <chenzhongjin@...wei.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "naveen.n.rao@...ux.vnet.ibm.com" <naveen.n.rao@...ux.vnet.ibm.com>
Subject: Re: [PATCH 01/16] powerpc: Replace unreachable() with it's builtin
 variant in WARN_ON()



Le 08/08/2022 à 13:48, Sathvika Vasireddy a écrit :
> objtool is throwing *unannotated intra-function call*
> warnings with a few instructions that are marked
> unreachable. Replace unreachable() with __builtin_unreachable()
> to fix these warnings, as the codegen remains same
> with unreachable() and __builtin_unreachable().

I think it is necessary to explain why using unreachable() is not 
necessary for powerpc, or even why using unreachable() is wrong.

Allthough we are getting rid of the problem here by replacing 
unreachable() by __builtin_unreachable(), it might still be a problem in 
core parts of kernel which still use unreachable.

So maybe it would be better to leave that as is, and instead modify 
annotate_unreachable() so that only architectures requiring it 
absolutely get it. For instance by defining and using a new config item, 
for instance CONFIG_OBJTOOL_NEEDS_ANNOTATE_UNREACHABLE

> 
> Signed-off-by: Sathvika Vasireddy <sv@...ux.ibm.com>
> ---
>   arch/powerpc/include/asm/bug.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h
> index 61a4736355c2..074be1a78c56 100644
> --- a/arch/powerpc/include/asm/bug.h
> +++ b/arch/powerpc/include/asm/bug.h
> @@ -99,7 +99,7 @@
>   	__label__ __label_warn_on;				\
>   								\
>   	WARN_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags), __label_warn_on); \
> -	unreachable();						\
> +	__builtin_unreachable();				\
>   								\
>   __label_warn_on:						\
>   	break;							\

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ