From: Todd Vierling Date: Fri, 9 Feb 2018 21:58:34 +0000 (-0500) Subject: kernel: on OL6 only, simulate the gcc 4.4 kABI for __stack_chk_fail() X-Git-Tag: v4.1.12-124.31.3~1136 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5cca067f8b78c0d8f90cd47abdec5fd3bed28e45;p=users%2Fjedix%2Flinux-maple.git kernel: on OL6 only, simulate the gcc 4.4 kABI for __stack_chk_fail() The __visible linkage changes st_value calculation for genksyms on newer compilers such as OL7's 4.8 and SCL's 4.9. However, this symbol is in the kABI whitelist and needs to retain its old st_value, even though the guts of the compiled function have not changed. Add a special directive, CONFIG_SIMULATE_GCC44_KABI, which will mask the __visible qualifier at genksyms time; and use it only on OL6 builds. Orabug: 27509351 Signed-off-by: Todd Vierling Reviewed-by: Martin K. Petersen --- diff --git a/Kconfig b/Kconfig index c13f48d65898..6b1ed64d6cc9 100644 --- a/Kconfig +++ b/Kconfig @@ -8,4 +8,9 @@ config SRCARCH string option env="SRCARCH" +# special hack for UEK-OL6 to allow special kABI hacks +config SIMULATE_GCC44_KABI + bool "Simulate the gcc 4.4 kABI" + default n + source "arch/$SRCARCH/Kconfig" diff --git a/kernel/panic.c b/kernel/panic.c index e9999af53078..ec078a046b1d 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -542,7 +542,10 @@ EXPORT_SYMBOL(warn_slowpath_null); * Called when gcc's -fstack-protector feature is used, and * gcc detects corruption of the on-stack canary value */ -__visible void __stack_chk_fail(void) +#if !defined(CONFIG_SIMULATE_GCC44_KABI) || !defined(__GENKSYMS__) +__visible +#endif +void __stack_chk_fail(void) { panic("stack-protector: Kernel stack is corrupted in: %p\n", __builtin_return_address(0)); diff --git a/uek-rpm/ol6/config-x86_64 b/uek-rpm/ol6/config-x86_64 index 6030414dfdb8..37046a6d84c8 100644 --- a/uek-rpm/ol6/config-x86_64 +++ b/uek-rpm/ol6/config-x86_64 @@ -6371,3 +6371,4 @@ CONFIG_FONT_SUPPORT=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_SIMULATE_GCC44_KABI=y diff --git a/uek-rpm/ol6/config-x86_64-debug b/uek-rpm/ol6/config-x86_64-debug index 7a5ff8723015..4eaf52f033af 100644 --- a/uek-rpm/ol6/config-x86_64-debug +++ b/uek-rpm/ol6/config-x86_64-debug @@ -6388,3 +6388,4 @@ CONFIG_FONT_SUPPORT=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_SIMULATE_GCC44_KABI=y