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: <1662371888.dwl4kym6qm.naveen@linux.ibm.com>
Date:   Mon, 05 Sep 2022 15:48:31 +0530
From:   "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
To:     Christophe Leroy <christophe.leroy@...roup.eu>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        Sathvika Vasireddy <sv@...ux.ibm.com>
Cc:     "aik@...abs.ru" <aik@...abs.ru>,
        "chenzhongjin@...wei.com" <chenzhongjin@...wei.com>,
        "jpoimboe@...hat.com" <jpoimboe@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "mbenes@...e.cz" <mbenes@...e.cz>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "mpe@...erman.id.au" <mpe@...erman.id.au>,
        "npiggin@...il.com" <npiggin@...il.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>
Subject: Re: [PATCH v2 01/16] powerpc: Replace unreachable() with it's builtin
 variant in __WARN_FLAGS()

Christophe Leroy wrote:
> 
> 
> Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit :
>> objtool is throwing *unannotated intra-function call* warnings in
>> .c files with a few instructions that are marked unreachable. The
>> problem comes from the annotate_unreachable() macro that is
>> called by unreachable(). This annotation is adding a call to a
>> function with size 0, and objtool does not add such symbols
>> to the rbtree. Due to this reason, find_call_destination() function
>> is not able to find the destination symbol for that call.
>> 
>> With the annotation (annotate_unreachable()), gcc seems to
>> generate a 'bl' to unreachable symbol with size 0. But with
>> the builtin variant of unreachable (__builtin_unreachable()),
>> gcc does not emit calls to such symbols and the warnings
>> go away. Given that the codegen remains same, and that
>> there are no 'bl' instructions to such symbols emitted, fix
>> these warnings by replacing unreachable() with it's builtin
>> variant in __WARN_FLAGS().
> 
> How can you say that the codegen remains the same if with the original 
> you get stale 'bl' instructions and with the alternative you don't ?

I guess the reference to codegen remaining the same is more to do with 
unreachable vs. __builtin_unreachable() in the absence of 
CONFIG_OBJTOOL. But yeah, the changelog needs to be reworked to clarify 
that.

> 
>> 
>> Also, add barrier_before_unreachable() before __builtin_unreachable()
>> to work around a gcc bug [1], for the problem reported at [2].
> 
> Here my comment was not related to the gcc bug [1] but to gcc bug 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365 , which was worked 
> around by commit 173a3efd3edb ("bug.h: work around GCC PR82365 in BUG()")
> 
> By chance it also solve the problem [1] as you mention.

That's a good commit to reference, but please also retain a link to the 
new PR.


- Naveen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ