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: <EE2A76DE-973F-4FCD-AEC8-C24D9FFCC3F1@kernel.org>
Date:   Mon, 29 May 2023 21:23:39 -0700
From:   Kees Cook <kees@...nel.org>
To:     Joan Bruguera Micó <joanbrugueram@...il.com>,
        Thorsten Leemhuis <linux@...mhuis.info>
CC:     Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        linux-crypto@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Kees Cook <keescook@...omium.org>
Subject: Re: build error while building arch/x86/purgatory/sha256.o: invalid 'asm': operand is not a condition code [...]

On May 28, 2023 9:40:31 AM PDT, "Joan Bruguera Micó" <joanbrugueram@...il.com> wrote:
>I can also reproduce the problem with Arch's linux-next-git, see config:
>https://aur.archlinux.org/cgit/aur.git/tree/config?h=linux-next-git&id=f9a384e1c582321651fb613782ebc5a581146af0
>
>I've bisected it to df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3"),
>which explains why it only happens on GCC13.
>
>The problematic expansion that causes the error seems to be this fragment
>from `_BUG_FLAGS` in `arch/x86/include/asm/bug.h`:
>    asm(".long %c0 - .\n": : "i" (__FILE__));
>
>Along with the fact that this file is built with `-mcmodel=large`
>(see `PURGATORY_CFLAGS` in `arch/x86/purgatory/Makefile`).

I haven't reproduced this yet, but the error implies that the asm input "i"mmediate value of the __FILE__ string address cannot be used with the asm template format "%c0" (a constant value).

https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Generic-Operand-Modifiers

I cannot fathom why struct flex array logic would change that...

I'll take a closer look in the morning.

-Kees


-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ