]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kernel: on OL6 only, simulate the gcc 4.4 kABI for __stack_chk_fail()
authorTodd Vierling <todd.vierling@oracle.com>
Fri, 9 Feb 2018 21:58:34 +0000 (16:58 -0500)
committerJack Vogel <jack.vogel@oracle.com>
Mon, 12 Feb 2018 18:07:21 +0000 (10:07 -0800)
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 <todd.vierling@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Kconfig
kernel/panic.c
uek-rpm/ol6/config-x86_64
uek-rpm/ol6/config-x86_64-debug

diff --git a/Kconfig b/Kconfig
index c13f48d65898487105f0193667648382c90d0eda..6b1ed64d6cc9b7b72201fe34851377a0c6c455cf 100644 (file)
--- 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"
index e9999af5307831bca47199abe8e70a05a7102ce3..ec078a046b1d61c24c9de5cad3a0f299ec661569 100644 (file)
@@ -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));
index 6030414dfdb8b362ce2a5dff7fbacf7cf9671916..37046a6d84c81ddaa567af70e83b3595d0c8dc57 100644 (file)
@@ -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
index 7a5ff8723015fac2976a85cfd02113d7eb472388..4eaf52f033afda04ae42bb132a71a2727bbff9c8 100644 (file)
@@ -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