summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2019-04-03 09:40:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-27 16:42:00 +0200
commitbd44630a88e86d1f7cea808d1264a82ce6d1d522 (patch)
tree903c22da1142ffdacb8862266835db8566381424
parente6cfc1098ef08ba5d1398f1d9c21530538d9005b (diff)
downloadlinux-stable-bd44630a88e86d1f7cea808d1264a82ce6d1d522.tar.gz
linux-stable-bd44630a88e86d1f7cea808d1264a82ce6d1d522.tar.bz2
linux-stable-bd44630a88e86d1f7cea808d1264a82ce6d1d522.zip
x86/uaccess, ubsan: Fix UBSAN vs. SMAP
commit d08965a27e84ca090b504844d50c24fc98587b11 upstream. UBSAN can insert extra code in random locations; including AC=1 sections. Typically this code is not safe and needs wrapping. So far, only __ubsan_handle_type_mismatch* have been observed in AC=1 sections and therefore only those are annotated. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> [stable backport: only take the lib/Makefile change to resolve gcc-10 build issues] Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--lib/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 452d2956a5a2..26fadc5d8310 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -230,5 +230,6 @@ obj-$(CONFIG_UCS2_STRING) += ucs2_string.o
obj-$(CONFIG_UBSAN) += ubsan.o
UBSAN_SANITIZE_ubsan.o := n
+CFLAGS_ubsan.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
obj-$(CONFIG_SBITMAP) += sbitmap.o