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]
Date:   Tue,  3 Oct 2017 13:58:22 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Catalin Marinas <catalin.marinas@....com>
Cc:     Will Deacon <will.deacon@....com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Guenter Roeck <linux@...ck-us.net>,
        Douglas Anderson <dianders@...omium.org>
Subject: [PATCH] arm64: Enforce endianness build flags for LD and AS

If LD or AS is specified on the command line using "make LD=<my-ld>",
the endianness flag will not be added. Depending on the toolchain used,
this can result in endianness mismatch errors, such as

aarch64-cros-linux-gnu/binutils-bin/2.27.0/ld.bfd.real:
arch/arm64/crypto/.tmp_aes-ce-cipher.o:
	compiled for a big endian system and target is little endian

The problem was observed when using the Chrome OS build system (which sets
LD on the command line) for an arm64:allmodconfig build.

Use the override flag for both LD and AS to ensure that the endianness
flag is always set.

Cc: Douglas Anderson <dianders@...omium.org>
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
---
 arch/arm64/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 939b310913cf..d780d00bea9c 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -56,15 +56,15 @@ KBUILD_AFLAGS	+= $(call cc-option,-mabi=lp64)
 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS	+= -mbig-endian
 CHECKFLAGS	+= -D__AARCH64EB__
-AS		+= -EB
-LD		+= -EB
+override AS		+= -EB
+override LD		+= -EB
 LDFLAGS		+= -maarch64linuxb
 UTS_MACHINE	:= aarch64_be
 else
 KBUILD_CPPFLAGS	+= -mlittle-endian
 CHECKFLAGS	+= -D__AARCH64EL__
-AS		+= -EL
-LD		+= -EL
+override AS		+= -EL
+override LD		+= -EL
 LDFLAGS		+= -maarch64linux
 UTS_MACHINE	:= aarch64
 endif
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ