]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0063-x86-unwind-Rename-unwinder-config-options-to-CONFIG_.patch
4ce1c4e6ba8e32aed5c08cc2baee980ab715ac3e
[pve-kernel.git] / patches / kernel / 0063-x86-unwind-Rename-unwinder-config-options-to-CONFIG_.patch
1 From dcc61cf4d482d478979471795935733845fe757e Mon Sep 17 00:00:00 2001
2 From: Josh Poimboeuf <jpoimboe@redhat.com>
3 Date: Fri, 13 Oct 2017 15:02:00 -0500
4 Subject: [PATCH 063/233] x86/unwind: Rename unwinder config options to
5 'CONFIG_UNWINDER_*'
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 CVE-2017-5754
11
12 Rename the unwinder config options from:
13
14 CONFIG_ORC_UNWINDER
15 CONFIG_FRAME_POINTER_UNWINDER
16 CONFIG_GUESS_UNWINDER
17
18 to:
19
20 CONFIG_UNWINDER_ORC
21 CONFIG_UNWINDER_FRAME_POINTER
22 CONFIG_UNWINDER_GUESS
23
24 ... in order to give them a more logical config namespace.
25
26 Suggested-by: Ingo Molnar <mingo@kernel.org>
27 Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
28 Cc: Linus Torvalds <torvalds@linux-foundation.org>
29 Cc: Peter Zijlstra <peterz@infradead.org>
30 Cc: Thomas Gleixner <tglx@linutronix.de>
31 Link: http://lkml.kernel.org/r/73972fc7e2762e91912c6b9584582703d6f1b8cc.1507924831.git.jpoimboe@redhat.com
32 Signed-off-by: Ingo Molnar <mingo@kernel.org>
33 (cherry picked from commit 11af847446ed0d131cf24d16a7ef3d5ea7a49554)
34 Signed-off-by: Andy Whitcroft <apw@canonical.com>
35 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
36 (cherry picked from commit 27ab2a240a797b073ce63385b1d5db06e44fc3ae)
37 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
38 ---
39 Documentation/x86/orc-unwinder.txt | 2 +-
40 Makefile | 4 ++--
41 arch/x86/kernel/Makefile | 6 +++---
42 scripts/Makefile.build | 2 +-
43 arch/x86/include/asm/module.h | 2 +-
44 arch/x86/include/asm/unwind.h | 8 ++++----
45 include/asm-generic/vmlinux.lds.h | 2 +-
46 arch/x86/Kconfig | 2 +-
47 arch/x86/Kconfig.debug | 10 +++++-----
48 arch/x86/configs/tiny.config | 4 ++--
49 arch/x86/configs/x86_64_defconfig | 2 +-
50 lib/Kconfig.debug | 2 +-
51 12 files changed, 23 insertions(+), 23 deletions(-)
52
53 diff --git a/Documentation/x86/orc-unwinder.txt b/Documentation/x86/orc-unwinder.txt
54 index af0c9a4c65a6..cd4b29be29af 100644
55 --- a/Documentation/x86/orc-unwinder.txt
56 +++ b/Documentation/x86/orc-unwinder.txt
57 @@ -4,7 +4,7 @@ ORC unwinder
58 Overview
59 --------
60
61 -The kernel CONFIG_ORC_UNWINDER option enables the ORC unwinder, which is
62 +The kernel CONFIG_UNWINDER_ORC option enables the ORC unwinder, which is
63 similar in concept to a DWARF unwinder. The difference is that the
64 format of the ORC data is much simpler than DWARF, which in turn allows
65 the ORC unwinder to be much simpler and faster.
66 diff --git a/Makefile b/Makefile
67 index 490ce18685ea..b740e3dc9ff8 100644
68 --- a/Makefile
69 +++ b/Makefile
70 @@ -965,8 +965,8 @@ ifdef CONFIG_STACK_VALIDATION
71 ifeq ($(has_libelf),1)
72 objtool_target := tools/objtool FORCE
73 else
74 - ifdef CONFIG_ORC_UNWINDER
75 - $(error "Cannot generate ORC metadata for CONFIG_ORC_UNWINDER=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
76 + ifdef CONFIG_UNWINDER_ORC
77 + $(error "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
78 else
79 $(warning "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel")
80 endif
81 diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
82 index e2315aecc441..5bf0d5a473b4 100644
83 --- a/arch/x86/kernel/Makefile
84 +++ b/arch/x86/kernel/Makefile
85 @@ -125,9 +125,9 @@ obj-$(CONFIG_PERF_EVENTS) += perf_regs.o
86 obj-$(CONFIG_TRACING) += tracepoint.o
87 obj-$(CONFIG_SCHED_MC_PRIO) += itmt.o
88
89 -obj-$(CONFIG_ORC_UNWINDER) += unwind_orc.o
90 -obj-$(CONFIG_FRAME_POINTER_UNWINDER) += unwind_frame.o
91 -obj-$(CONFIG_GUESS_UNWINDER) += unwind_guess.o
92 +obj-$(CONFIG_UNWINDER_ORC) += unwind_orc.o
93 +obj-$(CONFIG_UNWINDER_FRAME_POINTER) += unwind_frame.o
94 +obj-$(CONFIG_UNWINDER_GUESS) += unwind_guess.o
95
96 ###
97 # 64 bit specific files
98 diff --git a/scripts/Makefile.build b/scripts/Makefile.build
99 index ab2c8ef43cdb..436005392047 100644
100 --- a/scripts/Makefile.build
101 +++ b/scripts/Makefile.build
102 @@ -258,7 +258,7 @@ ifneq ($(SKIP_STACK_VALIDATION),1)
103
104 __objtool_obj := $(objtree)/tools/objtool/objtool
105
106 -objtool_args = $(if $(CONFIG_ORC_UNWINDER),orc generate,check)
107 +objtool_args = $(if $(CONFIG_UNWINDER_ORC),orc generate,check)
108
109 ifndef CONFIG_FRAME_POINTER
110 objtool_args += --no-fp
111 diff --git a/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h
112 index 9eb7c718aaf8..9f05a1002aa9 100644
113 --- a/arch/x86/include/asm/module.h
114 +++ b/arch/x86/include/asm/module.h
115 @@ -5,7 +5,7 @@
116 #include <asm/orc_types.h>
117
118 struct mod_arch_specific {
119 -#ifdef CONFIG_ORC_UNWINDER
120 +#ifdef CONFIG_UNWINDER_ORC
121 unsigned int num_orcs;
122 int *orc_unwind_ip;
123 struct orc_entry *orc_unwind;
124 diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h
125 index e9f793e2df7a..35d67dc7b69f 100644
126 --- a/arch/x86/include/asm/unwind.h
127 +++ b/arch/x86/include/asm/unwind.h
128 @@ -12,11 +12,11 @@ struct unwind_state {
129 struct task_struct *task;
130 int graph_idx;
131 bool error;
132 -#if defined(CONFIG_ORC_UNWINDER)
133 +#if defined(CONFIG_UNWINDER_ORC)
134 bool signal, full_regs;
135 unsigned long sp, bp, ip;
136 struct pt_regs *regs;
137 -#elif defined(CONFIG_FRAME_POINTER_UNWINDER)
138 +#elif defined(CONFIG_UNWINDER_FRAME_POINTER)
139 bool got_irq;
140 unsigned long *bp, *orig_sp, ip;
141 struct pt_regs *regs;
142 @@ -50,7 +50,7 @@ void unwind_start(struct unwind_state *state, struct task_struct *task,
143 __unwind_start(state, task, regs, first_frame);
144 }
145
146 -#if defined(CONFIG_ORC_UNWINDER) || defined(CONFIG_FRAME_POINTER_UNWINDER)
147 +#if defined(CONFIG_UNWINDER_ORC) || defined(CONFIG_UNWINDER_FRAME_POINTER)
148 static inline struct pt_regs *unwind_get_entry_regs(struct unwind_state *state)
149 {
150 if (unwind_done(state))
151 @@ -65,7 +65,7 @@ static inline struct pt_regs *unwind_get_entry_regs(struct unwind_state *state)
152 }
153 #endif
154
155 -#ifdef CONFIG_ORC_UNWINDER
156 +#ifdef CONFIG_UNWINDER_ORC
157 void unwind_init(void);
158 void unwind_module_init(struct module *mod, void *orc_ip, size_t orc_ip_size,
159 void *orc, size_t orc_size);
160 diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
161 index 9fdb54a95976..e71e42432360 100644
162 --- a/include/asm-generic/vmlinux.lds.h
163 +++ b/include/asm-generic/vmlinux.lds.h
164 @@ -686,7 +686,7 @@
165 #define BUG_TABLE
166 #endif
167
168 -#ifdef CONFIG_ORC_UNWINDER
169 +#ifdef CONFIG_UNWINDER_ORC
170 #define ORC_UNWIND_TABLE \
171 . = ALIGN(4); \
172 .orc_unwind_ip : AT(ADDR(.orc_unwind_ip) - LOAD_OFFSET) { \
173 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
174 index 3a0b8cb57caf..bf9f03740c30 100644
175 --- a/arch/x86/Kconfig
176 +++ b/arch/x86/Kconfig
177 @@ -168,7 +168,7 @@ config X86
178 select HAVE_PERF_REGS
179 select HAVE_PERF_USER_STACK_DUMP
180 select HAVE_REGS_AND_STACK_ACCESS_API
181 - select HAVE_RELIABLE_STACKTRACE if X86_64 && FRAME_POINTER_UNWINDER && STACK_VALIDATION
182 + select HAVE_RELIABLE_STACKTRACE if X86_64 && UNWINDER_FRAME_POINTER && STACK_VALIDATION
183 select HAVE_STACK_VALIDATION if X86_64
184 select HAVE_SYSCALL_TRACEPOINTS
185 select HAVE_UNSTABLE_SCHED_CLOCK
186 diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
187 index c441b5d65ec8..5435a943f894 100644
188 --- a/arch/x86/Kconfig.debug
189 +++ b/arch/x86/Kconfig.debug
190 @@ -358,13 +358,13 @@ config PUNIT_ATOM_DEBUG
191
192 choice
193 prompt "Choose kernel unwinder"
194 - default FRAME_POINTER_UNWINDER
195 + default UNWINDER_FRAME_POINTER
196 ---help---
197 This determines which method will be used for unwinding kernel stack
198 traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
199 livepatch, lockdep, and more.
200
201 -config FRAME_POINTER_UNWINDER
202 +config UNWINDER_FRAME_POINTER
203 bool "Frame pointer unwinder"
204 select FRAME_POINTER
205 ---help---
206 @@ -379,7 +379,7 @@ config FRAME_POINTER_UNWINDER
207 consistency model, as this is currently the only way to get a
208 reliable stack trace (CONFIG_HAVE_RELIABLE_STACKTRACE).
209
210 -config ORC_UNWINDER
211 +config UNWINDER_ORC
212 bool "ORC unwinder"
213 depends on X86_64
214 select STACK_VALIDATION
215 @@ -396,7 +396,7 @@ config ORC_UNWINDER
216 Enabling this option will increase the kernel's runtime memory usage
217 by roughly 2-4MB, depending on your kernel config.
218
219 -config GUESS_UNWINDER
220 +config UNWINDER_GUESS
221 bool "Guess unwinder"
222 depends on EXPERT
223 ---help---
224 @@ -411,7 +411,7 @@ config GUESS_UNWINDER
225 endchoice
226
227 config FRAME_POINTER
228 - depends on !ORC_UNWINDER && !GUESS_UNWINDER
229 + depends on !UNWINDER_ORC && !UNWINDER_GUESS
230 bool
231
232 endmenu
233 diff --git a/arch/x86/configs/tiny.config b/arch/x86/configs/tiny.config
234 index 550cd5012b73..66c9e2aab16c 100644
235 --- a/arch/x86/configs/tiny.config
236 +++ b/arch/x86/configs/tiny.config
237 @@ -1,5 +1,5 @@
238 CONFIG_NOHIGHMEM=y
239 # CONFIG_HIGHMEM4G is not set
240 # CONFIG_HIGHMEM64G is not set
241 -CONFIG_GUESS_UNWINDER=y
242 -# CONFIG_FRAME_POINTER_UNWINDER is not set
243 +CONFIG_UNWINDER_GUESS=y
244 +# CONFIG_UNWINDER_FRAME_POINTER is not set
245 diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
246 index eb65c248708d..e32fc1f274d8 100644
247 --- a/arch/x86/configs/x86_64_defconfig
248 +++ b/arch/x86/configs/x86_64_defconfig
249 @@ -299,7 +299,7 @@ CONFIG_DEBUG_STACKOVERFLOW=y
250 # CONFIG_DEBUG_RODATA_TEST is not set
251 CONFIG_DEBUG_BOOT_PARAMS=y
252 CONFIG_OPTIMIZE_INLINING=y
253 -CONFIG_ORC_UNWINDER=y
254 +CONFIG_UNWINDER_ORC=y
255 CONFIG_SECURITY=y
256 CONFIG_SECURITY_NETWORK=y
257 CONFIG_SECURITY_SELINUX=y
258 diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
259 index 0b4d1b3880b0..4f6ca5f60f7e 100644
260 --- a/lib/Kconfig.debug
261 +++ b/lib/Kconfig.debug
262 @@ -375,7 +375,7 @@ config STACK_VALIDATION
263 that runtime stack traces are more reliable.
264
265 This is also a prerequisite for generation of ORC unwind data, which
266 - is needed for CONFIG_ORC_UNWINDER.
267 + is needed for CONFIG_UNWINDER_ORC.
268
269 For more information, see
270 tools/objtool/Documentation/stack-validation.txt.
271 --
272 2.14.2
273