HomePhabricator

build: add -fstack-clash-protection to hardening flags

Description

build: add -fstack-clash-protection to hardening flags

Summary:
This option causes the compiler to insert probes whenever stack space
is allocated statically or dynamically to reliably detect stack overflows
and thus mitigate the attack vector that relies on jumping over a stack
guard page as provided by the operating system.

This option is now enabled by default in Ubuntu GCC as of 19.10.

Available in GCC 8 and Clang 11.

This concludes backport of core#18921
https://github.com/bitcoin/bitcoin/pull/18921/commits/b536813cefc13f5c54a28a7c2fce8c69e89d6624

Depends on D14008

Test Plan: gitian builds and guix build

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14013

Details

Provenance
PiRKAuthored on Jun 8 2023, 06:32
PiRKPushed on Jun 9 2023, 08:22
Reviewer
Restricted Project
Differential Revision
D14013: build: add -fstack-clash-protection to hardening flags
Parents
rABC55a6b186ddc8: build: use macOS 11 SDK (Xcode 12.2)
Branches
Unknown
Tags
Unknown