kasan: update kasan_global for gcc 7
authorDmitry Vyukov <[email protected]>
Wed, 30 Nov 2016 23:54:13 +0000 (15:54 -0800)
committerLinus Torvalds <[email protected]>
Thu, 1 Dec 2016 00:32:52 +0000 (16:32 -0800)
kasan_global struct is part of compiler/runtime ABI.  gcc revision
241983 has added a new field to kasan_global struct.  Update kernel
definition of kasan_global struct to include the new field.

Without this patch KASAN is broken with gcc 7.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Dmitry Vyukov <[email protected]>
Acked-by: Andrey Ryabinin <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: <[email protected]> [4.0+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/compiler-gcc.h
mm/kasan/kasan.h

index 432f5c97e18f4f75fd68b1c1101cf828fb3d4fa0..928e5ca0caee271e849fabeff0fa522a59650cc6 100644 (file)
 #endif
 #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */
 
-#if GCC_VERSION >= 50000
+#if GCC_VERSION >= 70000
+#define KASAN_ABI_VERSION 5
+#elif GCC_VERSION >= 50000
 #define KASAN_ABI_VERSION 4
 #elif GCC_VERSION >= 40902
 #define KASAN_ABI_VERSION 3
index e5c2181fee6f5ddeee0a6f912ba810637eeceb0c..03f4545b103d70706ae2b81f0a373416ec126967 100644 (file)
@@ -53,6 +53,9 @@ struct kasan_global {
 #if KASAN_ABI_VERSION >= 4
        struct kasan_source_location *location;
 #endif
+#if KASAN_ABI_VERSION >= 5
+       char *odr_indicator;
+#endif
 };
 
 /**