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-next>] [day] [month] [year] [list]
Message-Id: <20230418064228.21577-1-w@1wt.eu>
Date:   Tue, 18 Apr 2023 08:42:28 +0200
From:   Willy Tarreau <w@....eu>
To:     Borislav Petkov <bp@...en8.de>
Cc:     Jingbo Xu <jefflexu@...ux.alibaba.com>, tglx@...utronix.de,
        mingo@...hat.com, dave.hansen@...ux.intel.com, hpa@...or.com,
        x86@...nel.org, linux-kernel@...r.kernel.org,
        Willy Tarreau <w@....eu>
Subject: [PATCH] x86/alternatives: fix build issue with binutils before 2.28

The usage of the BIT() macro in asm code was introduced in 6.3 in by
commit 5d1dd961e743 ("x86/alternatives: Add alt_instr.flags") but this
macro uses "1UL" in the shift operations, while gas before 2.28 do not
support the "L" suffix after a number, and those before 2.27 do not
support the "U" suffix, resulting in build errors such as the following
with such versions:

  ./arch/x86/include/asm/uaccess_64.h:124: Error: found 'L', expected: ')'
  ./arch/x86/include/asm/uaccess_64.h:124: Error: junk at end of line,
  first unrecognized character is `L'

There's a single use of this macro here, let's revert to (1 << 0) that
works with such older binutils.

Cc: Jingbo Xu <jefflexu@...ux.alibaba.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: "H. Peter Anvin" <hpa@...or.com>
Link: https://lore.kernel.org/lkml/a9aae568-3046-306c-bd71-92c1fc8eeddc@linux.alibaba.com/
Signed-off-by: Willy Tarreau <w@....eu>
---

Boris, I understood from your message that 2.28 was the first working version,
so that's what I mentioned here. My tests showed that 2.27 wasn't sufficient
and that 2.29 was OK. If I was wrong and it's 2.29 instead, feel free to edit
the subject line, description and the comment, I'm totally fine with this!


 arch/x86/include/asm/alternative.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index e2975a32d443..b119685c0b31 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -8,7 +8,7 @@
 
 #define ALT_FLAGS_SHIFT		16
 
-#define ALT_FLAG_NOT		BIT(0)
+#define ALT_FLAG_NOT		(1 << 0) /* note: gas < 2.28 can't use BIT(0) */
 #define ALT_NOT(feature)	((ALT_FLAG_NOT << ALT_FLAGS_SHIFT) | (feature))
 
 #ifndef __ASSEMBLY__
-- 
2.35.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ