]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - pending-4.14/x86-uaccess-kcov-disable-stack-protector.patch
Linux 5.1.11
[thirdparty/kernel/stable-queue.git] / pending-4.14 / x86-uaccess-kcov-disable-stack-protector.patch
CommitLineData
1cd4ef76
SL
1From 42471536684223f24c8733b0378145017b914389 Mon Sep 17 00:00:00 2001
2From: Peter Zijlstra <peterz@infradead.org>
3Date: Thu, 7 Mar 2019 19:54:25 +0100
4Subject: x86/uaccess, kcov: Disable stack protector
5
6[ Upstream commit 40ea97290b08be2e038b31cbb33097d1145e8169 ]
7
8New tooling noticed this mishap:
9
10 kernel/kcov.o: warning: objtool: write_comp_data()+0x138: call to __stack_chk_fail() with UACCESS enabled
11 kernel/kcov.o: warning: objtool: __sanitizer_cov_trace_pc()+0xd9: call to __stack_chk_fail() with UACCESS enabled
12
13All the other instrumentation (KASAN,UBSAN) also have stack protector
14disabled.
15
16Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
17Cc: Borislav Petkov <bp@alien8.de>
18Cc: Josh Poimboeuf <jpoimboe@redhat.com>
19Cc: Linus Torvalds <torvalds@linux-foundation.org>
20Cc: Peter Zijlstra <peterz@infradead.org>
21Cc: Thomas Gleixner <tglx@linutronix.de>
22Signed-off-by: Ingo Molnar <mingo@kernel.org>
23Signed-off-by: Sasha Levin <sashal@kernel.org>
24---
25 kernel/Makefile | 1 +
26 1 file changed, 1 insertion(+)
27
28diff --git a/kernel/Makefile b/kernel/Makefile
29index 172d151d429c..3085141c055c 100644
30--- a/kernel/Makefile
31+++ b/kernel/Makefile
32@@ -30,6 +30,7 @@ KCOV_INSTRUMENT_extable.o := n
33 # Don't self-instrument.
34 KCOV_INSTRUMENT_kcov.o := n
35 KASAN_SANITIZE_kcov.o := n
36+CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
37
38 # cond_syscall is currently not LTO compatible
39 CFLAGS_sys_ni.o = $(DISABLE_LTO)
40--
412.20.1
42