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]
Date:   Fri,  1 Jun 2018 09:55:48 -0700
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     akpm@...ux-foundation.org, ard.biesheuvel@...aro.org,
        aryabinin@...tuozzo.com, akataria@...are.com,
        boris.ostrovsky@...cle.com, brijesh.singh@....com,
        caoj.fnst@...fujitsu.com, gregkh@...uxfoundation.org,
        hpa@...or.com, jan.kiszka@...mens.com,
        jarkko.sakkinen@...ux.intel.com, jgross@...e.com,
        jpoimboe@...hat.com, kirill.shutemov@...ux.intel.com,
        mingo@...hat.com, mjg59@...gle.com, mka@...omium.org,
        ndesaulniers@...gle.com, pombredanne@...b.com, rostedt@...dmis.org,
        tglx@...utronix.de, thomas.lendacky@....com, tweek@...gle.com
Cc:     linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org,
        x86@...nel.org, virtualization@...ts.linux-foundation.org
Subject: [PATCH 1/3] efi: use -std=gnu89 for proper extern inline semantics

The top level Makefile explicitly sets the C standard used in the kernel
to gnu89. By overriding KBUILD_CFLAGS, the C standard used for this
subdir is now implicit based on compiler and compiler version. GCC
changes this implicit default from gnu89 to gnu11 in v5.1.

This implies that depending on compiler version, parts of the kernel are
being linked together from object files that were compiled with
different C standard compiler flags.

This is problematic for symbols declared as extern inline, as the
semantics have switched since gnu89. See also:
http://blahg.josefsipek.net/?p=529

Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
Suggested-by: Sedat Dilek <sedat.dilek@...il.com>
Tested-by: Sedat Dilek <sedat.dilek@...il.com>
---
 drivers/firmware/efi/libstub/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
index a34e9290a699..97ca53ab2b69 100644
--- a/drivers/firmware/efi/libstub/Makefile
+++ b/drivers/firmware/efi/libstub/Makefile
@@ -7,7 +7,7 @@
 #
 cflags-$(CONFIG_X86_32)		:= -march=i386
 cflags-$(CONFIG_X86_64)		:= -mcmodel=small
-cflags-$(CONFIG_X86)		+= -m$(BITS) -D__KERNEL__ -O2 \
+cflags-$(CONFIG_X86)		+= -m$(BITS) -D__KERNEL__ -O2 -std=gnu89 \
 				   -fPIC -fno-strict-aliasing -mno-red-zone \
 				   -mno-mmx -mno-sse -fshort-wchar
 
-- 
2.17.0.921.gf22659ad46-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ