diff --git a/Makefile b/Makefile index ffeb722c107..1b347f4dfd8 100644 --- a/Makefile +++ b/Makefile @@ -750,6 +750,7 @@ endif ifeq ($(CONFIG_STACKPROTECTOR),y) KBUILD_CFLAGS += $(call cc-option,-fstack-protector-strong) +KBUILD_CFLAGS += $(call cc-option,-mstack-protector-guard=global) CFLAGS_EFI += $(call cc-option,-fno-stack-protector) else KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) diff --git a/common/stackprot.c b/common/stackprot.c index d5b70616655..6495951a773 100644 --- a/common/stackprot.c +++ b/common/stackprot.c @@ -18,3 +18,8 @@ void __stack_chk_fail(void) panic("Stack smashing detected in function:\n%p relocated from %p", ra, ra - gd->reloc_off); } + +void __stack_chk_fail_local(void) +{ + __stack_chk_fail(); +}