linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Matthias Kaehlcke <mka@chromium.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-efi@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Nathan Chancellor <natechancellor@gmail.com>
Subject: [PATCH 4.4 19/70] efi/libstub/arm64: Set -fpie when building the EFI stub
Date: Mon, 26 Nov 2018 11:50:34 +0100	[thread overview]
Message-ID: <20181126105048.681817537@linuxfoundation.org> (raw)
In-Reply-To: <20181126105046.722096341@linuxfoundation.org>

4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

commit 91ee5b21ee026c49e4e7483de69b55b8b47042be upstream.

Clang may emit absolute symbol references when building in non-PIC mode,
even when using the default 'small' code model, which is already mostly
position independent to begin with, due to its use of adrp/add pairs
that have a relative range of +/- 4 GB. The remedy is to pass the -fpie
flag, which can be done safely now that the code has been updated to avoid
GOT indirections (which may be emitted due to the compiler assuming that
the PIC/PIE code may end up in a shared library that is subject to ELF
symbol preemption)

Passing -fpie when building code that needs to execute at an a priori
unknown offset is arguably an improvement in any case, and given that
the recent visibility changes allow the PIC build to pass with GCC as
well, let's add -fpie for all arm64 builds rather than only for Clang.

Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20170818194947.19347-5-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/firmware/efi/libstub/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/firmware/efi/libstub/Makefile
+++ b/drivers/firmware/efi/libstub/Makefile
@@ -10,7 +10,7 @@ cflags-$(CONFIG_X86)		+= -m$(BITS) -D__K
 				   -fPIC -fno-strict-aliasing -mno-red-zone \
 				   -mno-mmx -mno-sse -DDISABLE_BRANCH_PROFILING
 
-cflags-$(CONFIG_ARM64)		:= $(subst -pg,,$(KBUILD_CFLAGS))
+cflags-$(CONFIG_ARM64)		:= $(subst -pg,,$(KBUILD_CFLAGS)) -fpie
 cflags-$(CONFIG_ARM)		:= $(subst -pg,,$(KBUILD_CFLAGS)) \
 				   -fno-builtin -fpic -mno-single-pic-base
 



  parent reply	other threads:[~2018-11-26 10:54 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 10:50 [PATCH 4.4 00/70] 4.4.165-stable review Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 01/70] flow_dissector: do not dissect l4 ports for fragments Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 02/70] ip_tunnel: dont force DF when MTU is locked Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 03/70] net-gro: reset skb->pkt_type in napi_reuse_skb() Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 04/70] tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 05/70] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 06/70] kbuild: Add better clang cross build support Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 07/70] kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 08/70] kbuild: Consolidate header generation from ASM offset information Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 09/70] kbuild: consolidate redundant sed script ASM offset generation Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 10/70] kbuild: fix asm-offset generation to work with clang Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 11/70] kbuild: drop -Wno-unknown-warning-option from clang options Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 12/70] kbuild, LLVMLinux: Add -Werror to cc-option to support clang Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 13/70] kbuild: use -Oz instead of -Os when using clang Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 14/70] kbuild: Add support to generate LLVM assembly files Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 15/70] modules: mark __inittest/__exittest as __maybe_unused Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 16/70] kbuild: clang: Disable address-of-packed-member warning Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 17/70] crypto: arm64/sha - avoid non-standard inline asm tricks Greg Kroah-Hartman
2020-11-23 20:49   ` dann frazier
2020-12-05 20:39     ` dann frazier
2020-12-06  9:46       ` Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 18/70] efi/libstub/arm64: Force hidden visibility for section markers Greg Kroah-Hartman
2018-11-26 10:50 ` Greg Kroah-Hartman [this message]
2018-11-26 10:50 ` [PATCH 4.4 20/70] kbuild: fix linker feature test macros when cross compiling with Clang Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 21/70] kbuild: Set KBUILD_CFLAGS before incl. arch Makefile Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 22/70] kbuild: move cc-option and cc-disable-warning after " Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 23/70] kbuild: clang: fix build failures with sparse check Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 24/70] kbuild: clang: remove crufty HOSTCFLAGS Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 25/70] kbuild: clang: disable unused variable warnings only when constant Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 26/70] kbuild: set no-integrated-as before incl. arch Makefile Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 27/70] kbuild: allow to use GCC toolchain not in Clang search path Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 28/70] arm64: Disable asm-operand-width warning for clang Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 29/70] x86/kbuild: Use cc-option to enable -falign-{jumps/loops} Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 30/70] crypto, x86: aesni - fix token pasting for clang Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 31/70] x86/mm/kaslr: Use the _ASM_MUL macro for multiplication to work around Clang incompatibility Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 32/70] kbuild: Add __cc-option macro Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 33/70] x86/build: Use __cc-option for boot code compiler options Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 34/70] x86/build: Specify stack alignment for clang Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 35/70] x86/boot: #undef memcpy() et al in string.c Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 36/70] x86/build: Fix stack alignment for CLang Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 37/70] x86/build: Use cc-option to validate stack alignment parameter Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 38/70] reiserfs: propagate errors from fill_with_dentries() properly Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 39/70] hfs: prevent btree data loss on root split Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 40/70] hfsplus: " Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 41/70] um: Give start_idle_thread() a return code Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 42/70] fs/exofs: fix potential memory leak in mount option parsing Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 43/70] clk: samsung: exynos5420: Enable PERIS clocks for suspend Greg Kroah-Hartman
2018-11-26 10:50 ` [PATCH 4.4 44/70] platform/x86: acerhdf: Add BIOS entry for Gateway LT31 v1.3307 Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 45/70] arm64: percpu: Initialize ret in the default case Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 46/70] s390/vdso: add missing FORCE to build targets Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 47/70] netfilter: ipset: actually allow allowable CIDR 0 in hash:net,port,net Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 48/70] s390/mm: Fix ERROR: "__node_distance" undefined! Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 49/70] netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment() Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 50/70] netfilter: xt_IDLETIMER: add sysfs filename checking routine Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 51/70] hwmon: (ibmpowernv) Remove bogus __init annotations Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 52/70] lib/raid6: Fix arm64 test build Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 53/70] i2c: omap: Enable for ARCH_K3 Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 54/70] zram: close udev startup race condition as default groups Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 55/70] SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer() Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 56/70] gfs2: Put bitmap buffers in put_super Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 57/70] btrfs: fix pinned underflow after transaction aborted Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 58/70] Revert "media: videobuf2-core: dont call memop finish when queueing" Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 59/70] Revert "Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV" Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 60/70] media: v4l: event: Add subscription to list before calling "add" operation Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 61/70] uio: Fix an Oops on load Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 62/70] usb: cdc-acm: add entry for Hiro (Conexant) modem Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 63/70] USB: quirks: Add no-lpm quirk for Raydium touchscreens Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 64/70] usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 65/70] misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 66/70] USB: misc: appledisplay: add 20" Apple Cinema Display Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 67/70] drivers/misc/sgi-gru: fix Spectre v1 vulnerability Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 68/70] ACPI / platform: Add SMB0001 HID to forbidden_id_list Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 69/70] new helper: uaccess_kernel() Greg Kroah-Hartman
2018-11-26 10:51 ` [PATCH 4.4 70/70] HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges Greg Kroah-Hartman
2018-11-26 16:29 ` [PATCH 4.4 00/70] 4.4.165-stable review kernelci.org bot
2018-11-26 23:49 ` Guenter Roeck
2018-11-26 23:54 ` shuah
2018-11-27  9:56 ` Harsh Shandilya
2018-11-27 14:39   ` Greg Kroah-Hartman
2018-11-27 13:09 ` Naresh Kamboju
2018-11-27 13:29 ` Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181126105048.681817537@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=mka@chromium.org \
    --cc=natechancellor@gmail.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).