]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.21/tracing-prevent-profile_all_branches-when-fortify_source-y.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.14.21 / tracing-prevent-profile_all_branches-when-fortify_source-y.patch
CommitLineData
79d769e9
GKH
1From 68e76e034b6b1c1ce2eece1ab8ae4008e14be470 Mon Sep 17 00:00:00 2001
2From: Randy Dunlap <rdunlap@infradead.org>
3Date: Mon, 15 Jan 2018 11:07:27 -0800
4Subject: tracing: Prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y
5
6From: Randy Dunlap <rdunlap@infradead.org>
7
8commit 68e76e034b6b1c1ce2eece1ab8ae4008e14be470 upstream.
9
10I regularly get 50 MB - 60 MB files during kernel randconfig builds.
11These large files mostly contain (many repeats of; e.g., 124,594):
12
13In file included from ../include/linux/string.h:6:0,
14 from ../include/linux/uuid.h:20,
15 from ../include/linux/mod_devicetable.h:13,
16 from ../scripts/mod/devicetable-offsets.c:3:
17../include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static [enabled by default]
18 ______f = { \
19 ^
20../include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
21 ^
22../include/linux/string.h:425:2: note: in expansion of macro 'if'
23 if (p_size == (size_t)-1 && q_size == (size_t)-1)
24 ^
25
26This only happens when CONFIG_FORTIFY_SOURCE=y and
27CONFIG_PROFILE_ALL_BRANCHES=y, so prevent PROFILE_ALL_BRANCHES if
28FORTIFY_SOURCE=y.
29
30Link: http://lkml.kernel.org/r/9199446b-a141-c0c3-9678-a3f9107f2750@infradead.org
31
32Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
33Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
34Cc: Arnd Bergmann <arnd@arndb.de>
35Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
36
37---
38 kernel/trace/Kconfig | 2 +-
39 1 file changed, 1 insertion(+), 1 deletion(-)
40
41--- a/kernel/trace/Kconfig
42+++ b/kernel/trace/Kconfig
43@@ -343,7 +343,7 @@ config PROFILE_ANNOTATED_BRANCHES
44 on if you need to profile the system's use of these macros.
45
46 config PROFILE_ALL_BRANCHES
47- bool "Profile all if conditionals"
48+ bool "Profile all if conditionals" if !FORTIFY_SOURCE
49 select TRACE_BRANCH_PROFILING
50 help
51 This tracer profiles all branch conditions. Every if ()