Skip to content

Commit 7f66cd3

Browse files
keesRussell King
authored andcommitted
ARM: 8500/1: fix atags_to_fdt with stack-protector-strong
Building with CONFIG_CC_STACKPROTECTOR_STRONG triggers protection code generation under CONFIG_ARM_ATAG_DTB_COMPAT but this is too early for being able to use any of the stack_chk code. Explicitly disable it for only the atags_to_fdt bits. Suggested-by: zhxihu <[email protected]> Signed-off-by: Kees Cook <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 92e963f commit 7f66cd3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/arm/boot/compressed/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS)
106106
KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
107107
endif
108108

109+
# -fstack-protector-strong triggers protection checks in this code,
110+
# but it is being used too early to link to meaningful stack_chk logic.
111+
nossp_flags := $(call cc-option, -fno-stack-protector)
112+
CFLAGS_atags_to_fdt.o := $(nossp_flags)
113+
CFLAGS_fdt.o := $(nossp_flags)
114+
CFLAGS_fdt_ro.o := $(nossp_flags)
115+
CFLAGS_fdt_rw.o := $(nossp_flags)
116+
CFLAGS_fdt_wip.o := $(nossp_flags)
117+
109118
ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj)
110119
asflags-y := -DZIMAGE
111120

0 commit comments

Comments
 (0)