Go to file
Christoph Müllner 1ed3998ba3 boot/arm-trusted-firmware: Forward stack protection configuration
TF-A supports stack smashing protection (-fstack-protector-*).
However, that feature is currently silently disabled because
ENABLE_STACK_PROTECTOR is not set during build time.

As documented in the TF-A user guide, the flag ENABLE_STACK_PROTECTOR
is required to enable stack protection support. When enabled the symbols
for the stack protector (e.g. __stack_chk_guard) are built.
This needs to be done because TF-A does not link against an external
library that provides that symbols (e.g. libc).

So in case we see that BR2_SSP_* is enabled, let's enable the corresponding
ENABLE_STACK_PROTECTOR build flag for TF-A as documented in the TF-A user guide.

This patch also fixes a the following linker errors with older TF-A versions
if BR2_SSP_* is enabled (i.e. -fstack-protector-* is used as compiler flag)
and ENABLE_STACK_PROTECTOR is not set, which are caused by the missing
stack protector symbols:

  [...]
  params_setup.c:(.text.params_early_setup+0xc): undefined reference to `__stack_chk_guard'
  aarch64-none-linux-gnu-ld: params_setup.c:(.text.params_early_setup+0x14): undefined reference to `__stack_chk_guard'
  aarch64-none-linux-gnu-ld: params_setup.c:(.text.params_early_setup+0x104): undefined reference to `__stack_chk_guard'
  aarch64-none-linux-gnu-ld: params_setup.c:(.text.params_early_setup+0x118): undefined reference to `__stack_chk_fail'
  aarch64-none-linux-gnu-ld: ./build/px30/release/bl31/pmu.o: in function `rockchip_soc_sys_pwr_dm_suspend':
  pmu.c:(.text.rockchip_soc_sys_pwr_dm_suspend+0xc): undefined reference to `__stack_chk_guard'
  [...]

TF-A releases after Nov 2019, that include 7af195e29a4, will circumvent
these issue by explicitliy and silently disabling the stack protector
by appending '-fno-stack-protector' to the compiler flags in case
ENABLE_STACK_PROTECTOR is not set.

Tested on a Rockchip PX30 based system (TF-A v2.2 and upstream/master).

Signed-off-by: Christoph Müllner <christoph.muellner@theobroma-systems.com>
Reviewed-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit 7b3fcbcdaa)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-12-21 15:16:12 +01:00
arch arch/x86: adds BR2_X86_CPU_HAS_3DNOW flag 2020-07-16 18:18:26 +02:00
board configs/beaglebone_qt5: switch to using KMS instead of wayland+weston 2020-12-21 10:56:39 +01:00
boot boot/arm-trusted-firmware: Forward stack protection configuration 2020-12-21 15:16:12 +01:00
configs configs/beaglebone_qt5: switch to using KMS instead of wayland+weston 2020-12-21 10:56:39 +01:00
docs docs/manual: Add section about contributing to maintenance branches 2020-09-15 19:46:48 +02:00
fs fs/cpio/init: unbreak ttyname_r() on glibc after dropping /dev/console exec 2020-08-29 19:40:49 +02:00
linux {linux, linux-headers}: bump 4.{4, 9, 14, 19}.x / 5.{4, 9}.x series 2020-12-11 13:46:27 +01:00
package package/libglib2: correct upstream status for patch 0001 2020-12-21 14:46:14 +01:00
support support/dependencies: clarify intended use of host bison/flex 2020-12-07 21:36:04 +01:00
system Revert "system: don't attempt swapon/swapoff in inittab if not available" 2020-02-08 20:13:07 +01:00
toolchain toolchain/toolchain-external/toolchain-external-arm-arm: add dependency on NEON 2020-11-16 16:05:34 +01:00
utils utils/scanpypi: use raw strings in re.compile/re.sub 2020-08-28 18:34:43 +02:00
.defconfig
.flake8 .flake8: fix check for 80/132 columns 2019-04-10 12:31:33 +02:00
.gitignore
.gitlab-ci.yml .gitlab-ci.yml: use python3 for flake8 run 2020-09-05 22:03:37 +02:00
.gitlab-ci.yml.in .gitlab-ci.yml: use python3 for flake8 run 2020-09-05 22:03:37 +02:00
CHANGES Update for 2020.02.8 2020-11-17 00:04:03 +01:00
Config.in Config.in: update BR2_OPTIMIZE_FAST prompt and help text 2020-07-22 13:38:51 +02:00
Config.in.legacy package/python-pycrypto: remove package 2020-05-31 22:36:03 +02:00
COPYING
DEVELOPERS DEVELOPERS: update email address for Pierre-Jean Texier 2020-12-06 23:23:13 +01:00
Makefile Update for 2020.02.8 2020-11-17 00:04:03 +01:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches