From b1343da6525bc7f610a8829492c77d1206f813b8 Mon Sep 17 00:00:00 2001 From: Tao Zeng Date: Mon, 28 Jan 2019 10:18:11 +0800 Subject: [PATCH] config: replace stack protector config [1/1] PD#SWPL-4617 Problem: CONFIG_CC_STACKPROTECTOR_STRONG will increase stack size for some large functions and may cause stack overflow problems or increase real stack usage after we have enabled VMAP STACK config. But direct remove it from defconfig will cause CTS fail. Solution: using CONFIG_CC_STACKPROTECTOR_STRONG_AMLOGIC for real stack protect config Verify: p212 Change-Id: I1ccba2ef6ab5ea6f2987af2986e0cf222da1a7c7 Signed-off-by: Tao Zeng --- Makefile | 2 +- arch/Kconfig | 5 +++++ arch/arm/configs/meson64_a32_defconfig | 1 + arch/arm64/configs/meson64_defconfig | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2858e74..cdea6ae 100644 --- a/Makefile +++ b/Makefile @@ -756,7 +756,7 @@ ifdef CONFIG_CC_STACKPROTECTOR_REGULAR stackp-flag := -fstack-protector stackp-name := REGULAR else -ifdef CONFIG_CC_STACKPROTECTOR_STRONG +ifdef CONFIG_CC_STACKPROTECTOR_STRONG_AMLOGIC stackp-flag := -fstack-protector-strong stackp-name := STRONG else diff --git a/arch/Kconfig b/arch/Kconfig index 0847b5d..c734874 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -448,6 +448,11 @@ config CC_STACKPROTECTOR_REGULAR config CC_STACKPROTECTOR_STRONG bool "Strong" + help + Since this config will increase stack size. We repleace it + +config CC_STACKPROTECTOR_STRONG_AMLOGIC + bool "Strong" select CC_STACKPROTECTOR help Functions will have the stack-protector canary logic added in any diff --git a/arch/arm/configs/meson64_a32_defconfig b/arch/arm/configs/meson64_a32_defconfig index 57cf825..7b0a2aa 100644 --- a/arch/arm/configs/meson64_a32_defconfig +++ b/arch/arm/configs/meson64_a32_defconfig @@ -30,6 +30,7 @@ CONFIG_EMBEDDED=y # CONFIG_COMPAT_BRK is not set CONFIG_PROFILING=y CONFIG_JUMP_LABEL=y +CONFIG_CC_STACKPROTECTOR_STRONG=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODVERSIONS=y diff --git a/arch/arm64/configs/meson64_defconfig b/arch/arm64/configs/meson64_defconfig index 7971d54..264c5e4 100644 --- a/arch/arm64/configs/meson64_defconfig +++ b/arch/arm64/configs/meson64_defconfig @@ -30,6 +30,7 @@ CONFIG_EMBEDDED=y # CONFIG_COMPAT_BRK is not set CONFIG_PROFILING=y CONFIG_JUMP_LABEL=y +CONFIG_CC_STACKPROTECTOR_STRONG=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODVERSIONS=y -- 2.7.4