All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich <geomatsi@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH/RFC 01/28] boot/arm-trusted-firmware: option to disable stack protection
Date: Tue,  1 Jun 2021 00:27:21 +0300	[thread overview]
Message-ID: <20210531212748.2378872-2-geomatsi@gmail.com> (raw)
In-Reply-To: <20210531212748.2378872-1-geomatsi@gmail.com>

Default value for ATF build flag  ENABLE_STACK_PROTECTOR is "none".
Buildroot sets appropriate ENABLE_STACK_PROTECTOR build flag value
based on the enabled BR2_SSP_* options. For any values other than
"none", ATF platform specific hook 'plat_get_stack_protector_canary'
should be implemented. However this hook is not implemented by all
the platforms supported by ATF. For instance, allwinner does not
provide such a hook.

Add new option BR2_TARGET_ARM_TRUSTED_FIRMWARE_DISABLE_SSP to disable
GCC stack protecton when selected ATF platform does not provide
support for this feature.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 boot/arm-trusted-firmware/Config.in               | 7 +++++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in
index c06294040e..9b851845b9 100644
--- a/boot/arm-trusted-firmware/Config.in
+++ b/boot/arm-trusted-firmware/Config.in
@@ -175,4 +175,11 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN
 	  Select this option if your ATF board configuration requires
 	  an ARM32 bare metal toolchain to be available.
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DISABLE_SSP
+	bool "Disable stack protection"
+	help
+	  Select this option to explicitly disable stack protection checks in GCC.
+	  Such checks need to be disabled if ATF platform port does not implement
+	  plat_get_stack_protector_canary() hook.
+
 endif
diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 0597cecf71..3fb65a01b3 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -100,6 +100,9 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)
 ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
 endif
 
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_DISABLE_SSP),y)
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ENABLE_STACK_PROTECTOR=none
+else
 ifeq ($(BR2_SSP_REGULAR),y)
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ENABLE_STACK_PROTECTOR=default
 else ifeq ($(BR2_SSP_STRONG),y)
@@ -107,6 +110,7 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ENABLE_STACK_PROTECTOR=strong
 else ifeq ($(BR2_SSP_ALL),y)
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ENABLE_STACK_PROTECTOR=all
 endif
+endif
 
 ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
 
-- 
2.31.1

  reply	other threads:[~2021-05-31 21:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 21:27 [Buildroot] [PATCH/RFC 00/28] sunxi: switch to mainline ATF Sergey Matyukevich
2021-05-31 21:27 ` Sergey Matyukevich [this message]
2021-06-07 14:09   ` [Buildroot] [PATCH/RFC 01/28] boot/arm-trusted-firmware: option to disable stack protection Heiko Thiery
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 02/28] support/testing: switch TestATFAllwinner to upstream ATF Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 03/28] support/testing/tests/boot/test_atf: update U-Boot in TestATFAllwinner Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 04/28] configs/orangepi_zero_plus2_defconfig: switch to upstream ATF Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 05/28] configs/bananapi_m64_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 06/28] configs/orangepi_zero_plus_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 07/28] configs/orangepi_pc2_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 08/28] configs/orangepi_prime_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 09/28] configs/orangepi_win_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 10/28] configs/friendlyarm_nanopi_a64_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 11/28] configs/friendlyarm_nanopi_neo2_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 12/28] configs/friendlyarm_nanopi_neo_plus2_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 13/28] configs/amarula_a64_relic_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 14/28] configs/olimex_a64_olinuxino_defconfig: switch to mainline ATF Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 15/28] configs/pine64_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 16/28] configs/pine64_sopine_defconfig: switch to upstream ATF Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 17/28] configs/orangepi-zero-plus2: bump BSP versions Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 18/28] configs/bananapi_m64_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 19/28] configs/orangepi_zero_plus_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 20/28] configs/orangepi_pc2_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 21/28] configs/orangepi_prime_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 22/28] configs/orangepi_win_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 23/28] configs/friendlyarm_nanopi_a64_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 24/28] configs/friendlyarm_nanopi_neo2_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 25/28] configs/friendlyarm_nanopi_neo_plus2_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 26/28] configs/olimex_a64_olinuxino_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 27/28] configs/pine64_defconfig: " Sergey Matyukevich
2021-05-31 21:27 ` [Buildroot] [PATCH/RFC 28/28] configs/pine64_sopine_defconfig: " Sergey Matyukevich
2021-06-02  9:46 ` [Buildroot] [PATCH/RFC 00/28] sunxi: switch to mainline ATF Heiko Thiery
2021-06-02 16:19   ` Sergey Matyukevich
2021-06-05 19:44     ` Yann E. MORIN

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=20210531212748.2378872-2-geomatsi@gmail.com \
    --to=geomatsi@gmail.com \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.