Skip to content

Commit 4f8f280

Browse files
committed
Enable stack smash protections by default
Disabled on platforms which use compilers that do not support the `-fstack-protector` compiler flag.
1 parent f232925 commit 4f8f280

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

Makefile.dep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ OLD_USEPKG := $(sort $(USEPKG))
1919
include $(RIOTBASE)/sys/Makefile.dep
2020
include $(RIOTBASE)/drivers/Makefile.dep
2121

22+
ifeq (,$(RIOTNOSSP))
23+
USEMODULE += ssp
24+
endif
25+
2226
ifneq (,$(filter ndn-riot,$(USEPKG)))
2327
USEMODULE += gnrc
2428
USEMODULE += xtimer

cpu/atmega_common/Makefile.include

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ USEMODULE += avr_libc_extra
99
PSEUDOMODULES += atmega_pcint
1010
PSEUDOMODULES += atmega_pcint%
1111

12+
# avr-gcc does not support -fstack-protector
13+
RIOTNOSSP = 1
14+
1215
include $(RIOTMAKE)/arch/atmega.inc.mk

cpu/mips_pic32_common/Makefile.include

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ INCLUDES += -I$(RIOTCPU)/mips_pic32_common/include
44

55
USEMODULE += mips_pic32_common
66
USEMODULE += mips_pic32_common_periph
7+
8+
# compiler does not support -fstack-protector
9+
RIOTNOSSP = 1

cpu/msp430_common/Makefile.include

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ export USEMODULE += msp430_common msp430_common_periph msp430_malloc
99

1010
DEFAULT_MODULE += oneway_malloc
1111

12+
# compiler does not support -fstack-protector
13+
RIOTNOSSP = 1
14+
1215
# include the msp430 common Makefile
1316
include $(RIOTMAKE)/arch/msp430.inc.mk

makefiles/vars.inc.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export APPDEPS # Files / Makefile targets that need to be created
2828
export RIOTBASE # The root folder of RIOT. The folder where this very file lives in.
2929
export RIOTCPU # For third party CPUs this folder is the base of the CPUs.
3030
export RIOTBOARD # This folder is the base of the riot boards.
31+
export RIOTNOSSP # Disable stack smash protections. NOT RECOMMENDED.
3132
export BOARDSDIR # For third party BOARDs this folder is the base of the BOARDs.
3233
export RIOTPKG # For overriding RIOT's pkg directory
3334
export RIOTTOOLS # Location of host machine tools

0 commit comments

Comments
 (0)