1 |
commit: 9abebf404153847abc1f7099dcf84b575579e415 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 27 16:59:32 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 27 16:59:32 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=9abebf40 |
7 |
|
8 |
proj/linux-patches: Linux patch 4.4.165 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1164_linux-4.4.165.patch | 1675 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1679 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index aeea8d7..d3f97eb 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -699,6 +699,10 @@ Patch: 1163_linux-4.4.164.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.4.164 |
23 |
|
24 |
+Patch: 1164_linux-4.4.165.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.4.165 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1164_linux-4.4.165.patch b/1164_linux-4.4.165.patch |
33 |
new file mode 100644 |
34 |
index 0000000..87f666b |
35 |
--- /dev/null |
36 |
+++ b/1164_linux-4.4.165.patch |
37 |
@@ -0,0 +1,1675 @@ |
38 |
+diff --git a/.gitignore b/.gitignore |
39 |
+index fd3a35592543..34fe1346aa87 100644 |
40 |
+--- a/.gitignore |
41 |
++++ b/.gitignore |
42 |
+@@ -33,6 +33,7 @@ |
43 |
+ *.lzo |
44 |
+ *.patch |
45 |
+ *.gcno |
46 |
++*.ll |
47 |
+ modules.builtin |
48 |
+ Module.symvers |
49 |
+ *.dwo |
50 |
+diff --git a/Kbuild b/Kbuild |
51 |
+index f55cefd9bf29..f56ed561a284 100644 |
52 |
+--- a/Kbuild |
53 |
++++ b/Kbuild |
54 |
+@@ -6,31 +6,6 @@ |
55 |
+ # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h) |
56 |
+ # 4) Check for missing system calls |
57 |
+ |
58 |
+-# Default sed regexp - multiline due to syntax constraints |
59 |
+-define sed-y |
60 |
+- "/^->/{s:->#\(.*\):/* \1 */:; \ |
61 |
+- s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ |
62 |
+- s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ |
63 |
+- s:->::; p;}" |
64 |
+-endef |
65 |
+- |
66 |
+-# Use filechk to avoid rebuilds when a header changes, but the resulting file |
67 |
+-# does not |
68 |
+-define filechk_offsets |
69 |
+- (set -e; \ |
70 |
+- echo "#ifndef $2"; \ |
71 |
+- echo "#define $2"; \ |
72 |
+- echo "/*"; \ |
73 |
+- echo " * DO NOT MODIFY."; \ |
74 |
+- echo " *"; \ |
75 |
+- echo " * This file was generated by Kbuild"; \ |
76 |
+- echo " */"; \ |
77 |
+- echo ""; \ |
78 |
+- sed -ne $(sed-y); \ |
79 |
+- echo ""; \ |
80 |
+- echo "#endif" ) |
81 |
+-endef |
82 |
+- |
83 |
+ ##### |
84 |
+ # 1) Generate bounds.h |
85 |
+ |
86 |
+diff --git a/Makefile b/Makefile |
87 |
+index 9382e7e4e750..441a760dc5a4 100644 |
88 |
+--- a/Makefile |
89 |
++++ b/Makefile |
90 |
+@@ -1,6 +1,6 @@ |
91 |
+ VERSION = 4 |
92 |
+ PATCHLEVEL = 4 |
93 |
+-SUBLEVEL = 164 |
94 |
++SUBLEVEL = 165 |
95 |
+ EXTRAVERSION = |
96 |
+ NAME = Blurry Fish Butt |
97 |
+ |
98 |
+@@ -303,14 +303,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
99 |
+ |
100 |
+ HOSTCC = gcc |
101 |
+ HOSTCXX = g++ |
102 |
+-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 |
103 |
++HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 |
104 |
+ HOSTCXXFLAGS = -O2 |
105 |
+ |
106 |
+-ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1) |
107 |
+-HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \ |
108 |
+- -Wno-missing-field-initializers -fno-delete-null-pointer-checks |
109 |
+-endif |
110 |
+- |
111 |
+ # Decide whether to build built-in, modular, or both. |
112 |
+ # Normally, just do built-in. |
113 |
+ |
114 |
+@@ -612,6 +607,22 @@ endif # $(dot-config) |
115 |
+ # Defaults to vmlinux, but the arch makefile usually adds further targets |
116 |
+ all: vmlinux |
117 |
+ |
118 |
++ifeq ($(cc-name),clang) |
119 |
++ifneq ($(CROSS_COMPILE),) |
120 |
++CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%)) |
121 |
++GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD))) |
122 |
++CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR) |
123 |
++GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..) |
124 |
++endif |
125 |
++ifneq ($(GCC_TOOLCHAIN),) |
126 |
++CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) |
127 |
++endif |
128 |
++KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) |
129 |
++KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) |
130 |
++KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) |
131 |
++KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) |
132 |
++endif |
133 |
++ |
134 |
+ # The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default |
135 |
+ # values of the respective KBUILD_* variables |
136 |
+ ARCH_CPPFLAGS := |
137 |
+@@ -628,7 +639,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) |
138 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) |
139 |
+ |
140 |
+ ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE |
141 |
+-KBUILD_CFLAGS += -Os |
142 |
++KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) |
143 |
+ else |
144 |
+ ifdef CONFIG_PROFILE_ALL_BRANCHES |
145 |
+ KBUILD_CFLAGS += -O2 |
146 |
+@@ -699,10 +710,9 @@ KBUILD_CFLAGS += $(stackp-flag) |
147 |
+ |
148 |
+ ifeq ($(cc-name),clang) |
149 |
+ KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) |
150 |
+-KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,) |
151 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) |
152 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) |
153 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, gnu) |
154 |
++KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) |
155 |
+ # Quiet clang warning: comparison of unsigned expression < 0 is always false |
156 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) |
157 |
+ # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the |
158 |
+@@ -713,11 +723,11 @@ KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) |
159 |
+ else |
160 |
+ |
161 |
+ # These warnings generated too much noise in a regular build. |
162 |
+-# Use make W=1 to enable them (see scripts/Makefile.build) |
163 |
++# Use make W=1 to enable them (see scripts/Makefile.extrawarn) |
164 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) |
165 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) |
166 |
+ endif |
167 |
+ |
168 |
++KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) |
169 |
+ ifdef CONFIG_FRAME_POINTER |
170 |
+ KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
171 |
+ else |
172 |
+@@ -1297,6 +1307,8 @@ help: |
173 |
+ @echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)' |
174 |
+ @echo ' dir/ - Build all files in dir and below' |
175 |
+ @echo ' dir/file.[ois] - Build specified target only' |
176 |
++ @echo ' dir/file.ll - Build the LLVM assembly file' |
177 |
++ @echo ' (requires compiler support for LLVM assembly generation)' |
178 |
+ @echo ' dir/file.lst - Build specified mixed source/assembly target only' |
179 |
+ @echo ' (requires a recent binutils and recent build (System.map))' |
180 |
+ @echo ' dir/file.ko - Build module including final link' |
181 |
+@@ -1472,6 +1484,7 @@ clean: $(clean-dirs) |
182 |
+ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ |
183 |
+ -o -name '*.symtypes' -o -name 'modules.order' \ |
184 |
+ -o -name modules.builtin -o -name '.tmp_*.o.*' \ |
185 |
++ -o -name '*.ll' \ |
186 |
+ -o -name '*.gcno' \) -type f -print | xargs rm -f |
187 |
+ |
188 |
+ # Generate tags for editors |
189 |
+@@ -1575,6 +1588,8 @@ endif |
190 |
+ $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
191 |
+ %.symtypes: %.c prepare scripts FORCE |
192 |
+ $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
193 |
++%.ll: %.c prepare scripts FORCE |
194 |
++ $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
195 |
+ |
196 |
+ # Modules |
197 |
+ /: prepare scripts FORCE |
198 |
+diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile |
199 |
+index b6c90e5006e4..c10bb98144b0 100644 |
200 |
+--- a/arch/arm64/Makefile |
201 |
++++ b/arch/arm64/Makefile |
202 |
+@@ -56,6 +56,10 @@ else |
203 |
+ TEXT_OFFSET := 0x00080000 |
204 |
+ endif |
205 |
+ |
206 |
++ifeq ($(cc-name),clang) |
207 |
++KBUILD_CFLAGS += $(call cc-disable-warning, asm-operand-widths) |
208 |
++endif |
209 |
++ |
210 |
+ # KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61) |
211 |
+ # in 32-bit arithmetic |
212 |
+ KASAN_SHADOW_OFFSET := $(shell printf "0x%08x00000000\n" $$(( \ |
213 |
+diff --git a/arch/arm64/crypto/sha1-ce-core.S b/arch/arm64/crypto/sha1-ce-core.S |
214 |
+index c98e7e849f06..8550408735a0 100644 |
215 |
+--- a/arch/arm64/crypto/sha1-ce-core.S |
216 |
++++ b/arch/arm64/crypto/sha1-ce-core.S |
217 |
+@@ -82,7 +82,8 @@ ENTRY(sha1_ce_transform) |
218 |
+ ldr dgb, [x0, #16] |
219 |
+ |
220 |
+ /* load sha1_ce_state::finalize */ |
221 |
+- ldr w4, [x0, #:lo12:sha1_ce_offsetof_finalize] |
222 |
++ ldr_l w4, sha1_ce_offsetof_finalize, x4 |
223 |
++ ldr w4, [x0, x4] |
224 |
+ |
225 |
+ /* load input */ |
226 |
+ 0: ld1 {v8.4s-v11.4s}, [x1], #64 |
227 |
+@@ -132,7 +133,8 @@ CPU_LE( rev32 v11.16b, v11.16b ) |
228 |
+ * the padding is handled by the C code in that case. |
229 |
+ */ |
230 |
+ cbz x4, 3f |
231 |
+- ldr x4, [x0, #:lo12:sha1_ce_offsetof_count] |
232 |
++ ldr_l w4, sha1_ce_offsetof_count, x4 |
233 |
++ ldr x4, [x0, x4] |
234 |
+ movi v9.2d, #0 |
235 |
+ mov x8, #0x80000000 |
236 |
+ movi v10.2d, #0 |
237 |
+diff --git a/arch/arm64/crypto/sha1-ce-glue.c b/arch/arm64/crypto/sha1-ce-glue.c |
238 |
+index aefda9868627..ea319c055f5d 100644 |
239 |
+--- a/arch/arm64/crypto/sha1-ce-glue.c |
240 |
++++ b/arch/arm64/crypto/sha1-ce-glue.c |
241 |
+@@ -17,9 +17,6 @@ |
242 |
+ #include <linux/crypto.h> |
243 |
+ #include <linux/module.h> |
244 |
+ |
245 |
+-#define ASM_EXPORT(sym, val) \ |
246 |
+- asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val)); |
247 |
+- |
248 |
+ MODULE_DESCRIPTION("SHA1 secure hash using ARMv8 Crypto Extensions"); |
249 |
+ MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@××××××.org>"); |
250 |
+ MODULE_LICENSE("GPL v2"); |
251 |
+@@ -32,6 +29,9 @@ struct sha1_ce_state { |
252 |
+ asmlinkage void sha1_ce_transform(struct sha1_ce_state *sst, u8 const *src, |
253 |
+ int blocks); |
254 |
+ |
255 |
++const u32 sha1_ce_offsetof_count = offsetof(struct sha1_ce_state, sst.count); |
256 |
++const u32 sha1_ce_offsetof_finalize = offsetof(struct sha1_ce_state, finalize); |
257 |
++ |
258 |
+ static int sha1_ce_update(struct shash_desc *desc, const u8 *data, |
259 |
+ unsigned int len) |
260 |
+ { |
261 |
+@@ -52,11 +52,6 @@ static int sha1_ce_finup(struct shash_desc *desc, const u8 *data, |
262 |
+ struct sha1_ce_state *sctx = shash_desc_ctx(desc); |
263 |
+ bool finalize = !sctx->sst.count && !(len % SHA1_BLOCK_SIZE); |
264 |
+ |
265 |
+- ASM_EXPORT(sha1_ce_offsetof_count, |
266 |
+- offsetof(struct sha1_ce_state, sst.count)); |
267 |
+- ASM_EXPORT(sha1_ce_offsetof_finalize, |
268 |
+- offsetof(struct sha1_ce_state, finalize)); |
269 |
+- |
270 |
+ /* |
271 |
+ * Allow the asm code to perform the finalization if there is no |
272 |
+ * partial data and the input is a round multiple of the block size. |
273 |
+diff --git a/arch/arm64/crypto/sha2-ce-core.S b/arch/arm64/crypto/sha2-ce-core.S |
274 |
+index 01cfee066837..679c6c002f4f 100644 |
275 |
+--- a/arch/arm64/crypto/sha2-ce-core.S |
276 |
++++ b/arch/arm64/crypto/sha2-ce-core.S |
277 |
+@@ -88,7 +88,8 @@ ENTRY(sha2_ce_transform) |
278 |
+ ld1 {dgav.4s, dgbv.4s}, [x0] |
279 |
+ |
280 |
+ /* load sha256_ce_state::finalize */ |
281 |
+- ldr w4, [x0, #:lo12:sha256_ce_offsetof_finalize] |
282 |
++ ldr_l w4, sha256_ce_offsetof_finalize, x4 |
283 |
++ ldr w4, [x0, x4] |
284 |
+ |
285 |
+ /* load input */ |
286 |
+ 0: ld1 {v16.4s-v19.4s}, [x1], #64 |
287 |
+@@ -136,7 +137,8 @@ CPU_LE( rev32 v19.16b, v19.16b ) |
288 |
+ * the padding is handled by the C code in that case. |
289 |
+ */ |
290 |
+ cbz x4, 3f |
291 |
+- ldr x4, [x0, #:lo12:sha256_ce_offsetof_count] |
292 |
++ ldr_l w4, sha256_ce_offsetof_count, x4 |
293 |
++ ldr x4, [x0, x4] |
294 |
+ movi v17.2d, #0 |
295 |
+ mov x8, #0x80000000 |
296 |
+ movi v18.2d, #0 |
297 |
+diff --git a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c |
298 |
+index 7cd587564a41..0ed9486f75dd 100644 |
299 |
+--- a/arch/arm64/crypto/sha2-ce-glue.c |
300 |
++++ b/arch/arm64/crypto/sha2-ce-glue.c |
301 |
+@@ -17,9 +17,6 @@ |
302 |
+ #include <linux/crypto.h> |
303 |
+ #include <linux/module.h> |
304 |
+ |
305 |
+-#define ASM_EXPORT(sym, val) \ |
306 |
+- asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val)); |
307 |
+- |
308 |
+ MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash using ARMv8 Crypto Extensions"); |
309 |
+ MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@××××××.org>"); |
310 |
+ MODULE_LICENSE("GPL v2"); |
311 |
+@@ -32,6 +29,11 @@ struct sha256_ce_state { |
312 |
+ asmlinkage void sha2_ce_transform(struct sha256_ce_state *sst, u8 const *src, |
313 |
+ int blocks); |
314 |
+ |
315 |
++const u32 sha256_ce_offsetof_count = offsetof(struct sha256_ce_state, |
316 |
++ sst.count); |
317 |
++const u32 sha256_ce_offsetof_finalize = offsetof(struct sha256_ce_state, |
318 |
++ finalize); |
319 |
++ |
320 |
+ static int sha256_ce_update(struct shash_desc *desc, const u8 *data, |
321 |
+ unsigned int len) |
322 |
+ { |
323 |
+@@ -52,11 +54,6 @@ static int sha256_ce_finup(struct shash_desc *desc, const u8 *data, |
324 |
+ struct sha256_ce_state *sctx = shash_desc_ctx(desc); |
325 |
+ bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE); |
326 |
+ |
327 |
+- ASM_EXPORT(sha256_ce_offsetof_count, |
328 |
+- offsetof(struct sha256_ce_state, sst.count)); |
329 |
+- ASM_EXPORT(sha256_ce_offsetof_finalize, |
330 |
+- offsetof(struct sha256_ce_state, finalize)); |
331 |
+- |
332 |
+ /* |
333 |
+ * Allow the asm code to perform the finalization if there is no |
334 |
+ * partial data and the input is a round multiple of the block size. |
335 |
+diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h |
336 |
+index 8a336852eeba..aea904713d0f 100644 |
337 |
+--- a/arch/arm64/include/asm/percpu.h |
338 |
++++ b/arch/arm64/include/asm/percpu.h |
339 |
+@@ -84,6 +84,7 @@ static inline unsigned long __percpu_##op(void *ptr, \ |
340 |
+ : [val] "Ir" (val)); \ |
341 |
+ break; \ |
342 |
+ default: \ |
343 |
++ ret = 0; \ |
344 |
+ BUILD_BUG(); \ |
345 |
+ } \ |
346 |
+ \ |
347 |
+@@ -113,6 +114,7 @@ static inline unsigned long __percpu_read(void *ptr, int size) |
348 |
+ ret = ACCESS_ONCE(*(u64 *)ptr); |
349 |
+ break; |
350 |
+ default: |
351 |
++ ret = 0; |
352 |
+ BUILD_BUG(); |
353 |
+ } |
354 |
+ |
355 |
+@@ -182,6 +184,7 @@ static inline unsigned long __percpu_xchg(void *ptr, unsigned long val, |
356 |
+ : [val] "r" (val)); |
357 |
+ break; |
358 |
+ default: |
359 |
++ ret = 0; |
360 |
+ BUILD_BUG(); |
361 |
+ } |
362 |
+ |
363 |
+diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile |
364 |
+index 3686d6abafde..9edda5466020 100644 |
365 |
+--- a/arch/ia64/kernel/Makefile |
366 |
++++ b/arch/ia64/kernel/Makefile |
367 |
+@@ -50,32 +50,10 @@ CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31 |
368 |
+ # The gate DSO image is built using a special linker script. |
369 |
+ include $(src)/Makefile.gate |
370 |
+ |
371 |
+-# Calculate NR_IRQ = max(IA64_NATIVE_NR_IRQS, XEN_NR_IRQS, ...) based on config |
372 |
+-define sed-y |
373 |
+- "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" |
374 |
+-endef |
375 |
+-quiet_cmd_nr_irqs = GEN $@ |
376 |
+-define cmd_nr_irqs |
377 |
+- (set -e; \ |
378 |
+- echo "#ifndef __ASM_NR_IRQS_H__"; \ |
379 |
+- echo "#define __ASM_NR_IRQS_H__"; \ |
380 |
+- echo "/*"; \ |
381 |
+- echo " * DO NOT MODIFY."; \ |
382 |
+- echo " *"; \ |
383 |
+- echo " * This file was generated by Kbuild"; \ |
384 |
+- echo " *"; \ |
385 |
+- echo " */"; \ |
386 |
+- echo ""; \ |
387 |
+- sed -ne $(sed-y) $<; \ |
388 |
+- echo ""; \ |
389 |
+- echo "#endif" ) > $@ |
390 |
+-endef |
391 |
+- |
392 |
+ # We use internal kbuild rules to avoid the "is up to date" message from make |
393 |
+ arch/$(SRCARCH)/kernel/nr-irqs.s: arch/$(SRCARCH)/kernel/nr-irqs.c |
394 |
+ $(Q)mkdir -p $(dir $@) |
395 |
+ $(call if_changed_dep,cc_s_c) |
396 |
+ |
397 |
+-include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s |
398 |
+- $(Q)mkdir -p $(dir $@) |
399 |
+- $(call cmd,nr_irqs) |
400 |
++include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s FORCE |
401 |
++ $(call filechk,offsets,__ASM_NR_IRQS_H__) |
402 |
+diff --git a/arch/s390/kernel/vdso32/Makefile b/arch/s390/kernel/vdso32/Makefile |
403 |
+index ee8a18e50a25..29b72c46284d 100644 |
404 |
+--- a/arch/s390/kernel/vdso32/Makefile |
405 |
++++ b/arch/s390/kernel/vdso32/Makefile |
406 |
+@@ -29,7 +29,7 @@ GCOV_PROFILE := n |
407 |
+ $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so |
408 |
+ |
409 |
+ # link rule for the .so file, .lds has to be first |
410 |
+-$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) |
411 |
++$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) FORCE |
412 |
+ $(call if_changed,vdso32ld) |
413 |
+ |
414 |
+ # strip rule for the .so file |
415 |
+@@ -38,12 +38,12 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE |
416 |
+ $(call if_changed,objcopy) |
417 |
+ |
418 |
+ # assembly rules for the .S files |
419 |
+-$(obj-vdso32): %.o: %.S |
420 |
++$(obj-vdso32): %.o: %.S FORCE |
421 |
+ $(call if_changed_dep,vdso32as) |
422 |
+ |
423 |
+ # actual build commands |
424 |
+ quiet_cmd_vdso32ld = VDSO32L $@ |
425 |
+- cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $^ -o $@ |
426 |
++ cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@ |
427 |
+ quiet_cmd_vdso32as = VDSO32A $@ |
428 |
+ cmd_vdso32as = $(CC) $(a_flags) -c -o $@ $< |
429 |
+ |
430 |
+diff --git a/arch/s390/kernel/vdso64/Makefile b/arch/s390/kernel/vdso64/Makefile |
431 |
+index c4b03f9ed228..1b083d80de50 100644 |
432 |
+--- a/arch/s390/kernel/vdso64/Makefile |
433 |
++++ b/arch/s390/kernel/vdso64/Makefile |
434 |
+@@ -29,7 +29,7 @@ GCOV_PROFILE := n |
435 |
+ $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so |
436 |
+ |
437 |
+ # link rule for the .so file, .lds has to be first |
438 |
+-$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) |
439 |
++$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) FORCE |
440 |
+ $(call if_changed,vdso64ld) |
441 |
+ |
442 |
+ # strip rule for the .so file |
443 |
+@@ -38,12 +38,12 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE |
444 |
+ $(call if_changed,objcopy) |
445 |
+ |
446 |
+ # assembly rules for the .S files |
447 |
+-$(obj-vdso64): %.o: %.S |
448 |
++$(obj-vdso64): %.o: %.S FORCE |
449 |
+ $(call if_changed_dep,vdso64as) |
450 |
+ |
451 |
+ # actual build commands |
452 |
+ quiet_cmd_vdso64ld = VDSO64L $@ |
453 |
+- cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@ |
454 |
++ cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $(filter %.lds %.o,$^) -o $@ |
455 |
+ quiet_cmd_vdso64as = VDSO64A $@ |
456 |
+ cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $< |
457 |
+ |
458 |
+diff --git a/arch/s390/numa/numa.c b/arch/s390/numa/numa.c |
459 |
+index 43f32ce60aa3..734f56d774bb 100644 |
460 |
+--- a/arch/s390/numa/numa.c |
461 |
++++ b/arch/s390/numa/numa.c |
462 |
+@@ -47,6 +47,7 @@ int __node_distance(int a, int b) |
463 |
+ { |
464 |
+ return mode->distance ? mode->distance(a, b) : 0; |
465 |
+ } |
466 |
++EXPORT_SYMBOL(__node_distance); |
467 |
+ |
468 |
+ int numa_debug_enabled; |
469 |
+ |
470 |
+diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c |
471 |
+index b856c66ebd3a..6dbf27ffafc8 100644 |
472 |
+--- a/arch/um/os-Linux/skas/process.c |
473 |
++++ b/arch/um/os-Linux/skas/process.c |
474 |
+@@ -585,6 +585,11 @@ int start_idle_thread(void *stack, jmp_buf *switch_buf) |
475 |
+ fatal_sigsegv(); |
476 |
+ } |
477 |
+ longjmp(*switch_buf, 1); |
478 |
++ |
479 |
++ /* unreachable */ |
480 |
++ printk(UM_KERN_ERR "impossible long jump!"); |
481 |
++ fatal_sigsegv(); |
482 |
++ return 0; |
483 |
+ } |
484 |
+ |
485 |
+ void initial_thread_cb_skas(void (*proc)(void *), void *arg) |
486 |
+diff --git a/arch/x86/Makefile b/arch/x86/Makefile |
487 |
+index d2c663aeccba..e26560cd1844 100644 |
488 |
+--- a/arch/x86/Makefile |
489 |
++++ b/arch/x86/Makefile |
490 |
+@@ -11,6 +11,16 @@ else |
491 |
+ KBUILD_DEFCONFIG := $(ARCH)_defconfig |
492 |
+ endif |
493 |
+ |
494 |
++# For gcc stack alignment is specified with -mpreferred-stack-boundary, |
495 |
++# clang has the option -mstack-alignment for that purpose. |
496 |
++ifneq ($(call cc-option, -mpreferred-stack-boundary=4),) |
497 |
++ cc_stack_align4 := -mpreferred-stack-boundary=2 |
498 |
++ cc_stack_align8 := -mpreferred-stack-boundary=3 |
499 |
++else ifneq ($(call cc-option, -mstack-alignment=16),) |
500 |
++ cc_stack_align4 := -mstack-alignment=4 |
501 |
++ cc_stack_align8 := -mstack-alignment=8 |
502 |
++endif |
503 |
++ |
504 |
+ # How to compile the 16-bit code. Note we always compile for -march=i386; |
505 |
+ # that way we can complain to the user if the CPU is insufficient. |
506 |
+ # |
507 |
+@@ -24,10 +34,11 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os -D__KERNEL__ \ |
508 |
+ -DDISABLE_BRANCH_PROFILING \ |
509 |
+ -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \ |
510 |
+ -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ |
511 |
+- -mno-mmx -mno-sse \ |
512 |
+- $(call cc-option, -ffreestanding) \ |
513 |
+- $(call cc-option, -fno-stack-protector) \ |
514 |
+- $(call cc-option, -mpreferred-stack-boundary=2) |
515 |
++ -mno-mmx -mno-sse |
516 |
++ |
517 |
++REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding) |
518 |
++REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector) |
519 |
++REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4)) |
520 |
+ export REALMODE_CFLAGS |
521 |
+ |
522 |
+ # BITS is used as extension for files which are available in a 32 bit |
523 |
+@@ -64,8 +75,10 @@ ifeq ($(CONFIG_X86_32),y) |
524 |
+ # with nonstandard options |
525 |
+ KBUILD_CFLAGS += -fno-pic |
526 |
+ |
527 |
+- # prevent gcc from keeping the stack 16 byte aligned |
528 |
+- KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) |
529 |
++ # Align the stack to the register width instead of using the default |
530 |
++ # alignment of 16 bytes. This reduces stack usage and the number of |
531 |
++ # alignment instructions. |
532 |
++ KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align4)) |
533 |
+ |
534 |
+ # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use |
535 |
+ # a lot more stack due to the lack of sharing of stacklots: |
536 |
+@@ -88,17 +101,23 @@ else |
537 |
+ KBUILD_CFLAGS += -m64 |
538 |
+ |
539 |
+ # Align jump targets to 1 byte, not the default 16 bytes: |
540 |
+- KBUILD_CFLAGS += -falign-jumps=1 |
541 |
++ KBUILD_CFLAGS += $(call cc-option,-falign-jumps=1) |
542 |
+ |
543 |
+ # Pack loops tightly as well: |
544 |
+- KBUILD_CFLAGS += -falign-loops=1 |
545 |
++ KBUILD_CFLAGS += $(call cc-option,-falign-loops=1) |
546 |
+ |
547 |
+ # Don't autogenerate traditional x87 instructions |
548 |
+ KBUILD_CFLAGS += $(call cc-option,-mno-80387) |
549 |
+ KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387) |
550 |
+ |
551 |
+- # Use -mpreferred-stack-boundary=3 if supported. |
552 |
+- KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) |
553 |
++ # By default gcc and clang use a stack alignment of 16 bytes for x86. |
554 |
++ # However the standard kernel entry on x86-64 leaves the stack on an |
555 |
++ # 8-byte boundary. If the compiler isn't informed about the actual |
556 |
++ # alignment it will generate extra alignment instructions for the |
557 |
++ # default alignment which keep the stack *mis*aligned. |
558 |
++ # Furthermore an alignment to the register width reduces stack usage |
559 |
++ # and the number of alignment instructions. |
560 |
++ KBUILD_CFLAGS += $(call cc-option,$(cc_stack_align8)) |
561 |
+ |
562 |
+ # Use -mskip-rax-setup if supported. |
563 |
+ KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup) |
564 |
+diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c |
565 |
+index 6a9b96b4624d..31dab2135188 100644 |
566 |
+--- a/arch/x86/boot/compressed/aslr.c |
567 |
++++ b/arch/x86/boot/compressed/aslr.c |
568 |
+@@ -1,5 +1,6 @@ |
569 |
+ #include "misc.h" |
570 |
+ |
571 |
++#include <asm/asm.h> |
572 |
+ #include <asm/msr.h> |
573 |
+ #include <asm/archrandom.h> |
574 |
+ #include <asm/e820.h> |
575 |
+@@ -94,7 +95,7 @@ static unsigned long get_random_long(void) |
576 |
+ } |
577 |
+ |
578 |
+ /* Circular multiply for better bit diffusion */ |
579 |
+- asm("mul %3" |
580 |
++ asm(_ASM_MUL "%3" |
581 |
+ : "=a" (random), "=d" (raw) |
582 |
+ : "a" (random), "rm" (mix_const)); |
583 |
+ random += raw; |
584 |
+diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c |
585 |
+index 06ceddb3a22e..1d56adea8a7c 100644 |
586 |
+--- a/arch/x86/boot/string.c |
587 |
++++ b/arch/x86/boot/string.c |
588 |
+@@ -16,6 +16,15 @@ |
589 |
+ #include "ctype.h" |
590 |
+ #include "string.h" |
591 |
+ |
592 |
++/* |
593 |
++ * Undef these macros so that the functions that we provide |
594 |
++ * here will have the correct names regardless of how string.h |
595 |
++ * may have chosen to #define them. |
596 |
++ */ |
597 |
++#undef memcpy |
598 |
++#undef memset |
599 |
++#undef memcmp |
600 |
++ |
601 |
+ int memcmp(const void *s1, const void *s2, size_t len) |
602 |
+ { |
603 |
+ u8 diff; |
604 |
+diff --git a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S |
605 |
+index a916c4a61165..5f6a5af9c489 100644 |
606 |
+--- a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S |
607 |
++++ b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S |
608 |
+@@ -65,7 +65,6 @@ |
609 |
+ #include <linux/linkage.h> |
610 |
+ #include <asm/inst.h> |
611 |
+ |
612 |
+-#define CONCAT(a,b) a##b |
613 |
+ #define VMOVDQ vmovdqu |
614 |
+ |
615 |
+ #define xdata0 %xmm0 |
616 |
+@@ -92,8 +91,6 @@ |
617 |
+ #define num_bytes %r8 |
618 |
+ |
619 |
+ #define tmp %r10 |
620 |
+-#define DDQ(i) CONCAT(ddq_add_,i) |
621 |
+-#define XMM(i) CONCAT(%xmm, i) |
622 |
+ #define DDQ_DATA 0 |
623 |
+ #define XDATA 1 |
624 |
+ #define KEY_128 1 |
625 |
+@@ -131,12 +128,12 @@ ddq_add_8: |
626 |
+ /* generate a unique variable for ddq_add_x */ |
627 |
+ |
628 |
+ .macro setddq n |
629 |
+- var_ddq_add = DDQ(\n) |
630 |
++ var_ddq_add = ddq_add_\n |
631 |
+ .endm |
632 |
+ |
633 |
+ /* generate a unique variable for xmm register */ |
634 |
+ .macro setxdata n |
635 |
+- var_xdata = XMM(\n) |
636 |
++ var_xdata = %xmm\n |
637 |
+ .endm |
638 |
+ |
639 |
+ /* club the numeric 'id' to the symbol 'name' */ |
640 |
+diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h |
641 |
+index 21e84a31d211..f3d4f1edc947 100644 |
642 |
+--- a/arch/x86/include/asm/asm.h |
643 |
++++ b/arch/x86/include/asm/asm.h |
644 |
+@@ -34,6 +34,7 @@ |
645 |
+ #define _ASM_ADD __ASM_SIZE(add) |
646 |
+ #define _ASM_SUB __ASM_SIZE(sub) |
647 |
+ #define _ASM_XADD __ASM_SIZE(xadd) |
648 |
++#define _ASM_MUL __ASM_SIZE(mul) |
649 |
+ |
650 |
+ #define _ASM_AX __ASM_REG(ax) |
651 |
+ #define _ASM_BX __ASM_REG(bx) |
652 |
+diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c |
653 |
+index 5365ff6e69c1..ee565b23795b 100644 |
654 |
+--- a/drivers/acpi/acpi_platform.c |
655 |
++++ b/drivers/acpi/acpi_platform.c |
656 |
+@@ -29,6 +29,7 @@ static const struct acpi_device_id forbidden_id_list[] = { |
657 |
+ {"PNP0200", 0}, /* AT DMA Controller */ |
658 |
+ {"ACPI0009", 0}, /* IOxAPIC */ |
659 |
+ {"ACPI000A", 0}, /* IOAPIC */ |
660 |
++ {"SMB0001", 0}, /* ACPI SMBUS virtual device */ |
661 |
+ {"", 0}, |
662 |
+ }; |
663 |
+ |
664 |
+diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c |
665 |
+index 502406c9e6e1..616ee4f9c233 100644 |
666 |
+--- a/drivers/block/zram/zram_drv.c |
667 |
++++ b/drivers/block/zram/zram_drv.c |
668 |
+@@ -1184,6 +1184,11 @@ static struct attribute_group zram_disk_attr_group = { |
669 |
+ .attrs = zram_disk_attrs, |
670 |
+ }; |
671 |
+ |
672 |
++static const struct attribute_group *zram_disk_attr_groups[] = { |
673 |
++ &zram_disk_attr_group, |
674 |
++ NULL, |
675 |
++}; |
676 |
++ |
677 |
+ /* |
678 |
+ * Allocate and initialize new zram device. the function returns |
679 |
+ * '>= 0' device_id upon success, and negative value otherwise. |
680 |
+@@ -1264,15 +1269,9 @@ static int zram_add(void) |
681 |
+ zram->disk->queue->limits.discard_zeroes_data = 0; |
682 |
+ queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, zram->disk->queue); |
683 |
+ |
684 |
++ disk_to_dev(zram->disk)->groups = zram_disk_attr_groups; |
685 |
+ add_disk(zram->disk); |
686 |
+ |
687 |
+- ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj, |
688 |
+- &zram_disk_attr_group); |
689 |
+- if (ret < 0) { |
690 |
+- pr_err("Error creating sysfs group for device %d\n", |
691 |
+- device_id); |
692 |
+- goto out_free_disk; |
693 |
+- } |
694 |
+ strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor)); |
695 |
+ zram->meta = NULL; |
696 |
+ zram->max_comp_streams = 1; |
697 |
+@@ -1280,9 +1279,6 @@ static int zram_add(void) |
698 |
+ pr_info("Added device: %s\n", zram->disk->disk_name); |
699 |
+ return device_id; |
700 |
+ |
701 |
+-out_free_disk: |
702 |
+- del_gendisk(zram->disk); |
703 |
+- put_disk(zram->disk); |
704 |
+ out_free_queue: |
705 |
+ blk_cleanup_queue(queue); |
706 |
+ out_free_idr: |
707 |
+@@ -1310,16 +1306,6 @@ static int zram_remove(struct zram *zram) |
708 |
+ zram->claim = true; |
709 |
+ mutex_unlock(&bdev->bd_mutex); |
710 |
+ |
711 |
+- /* |
712 |
+- * Remove sysfs first, so no one will perform a disksize |
713 |
+- * store while we destroy the devices. This also helps during |
714 |
+- * hot_remove -- zram_reset_device() is the last holder of |
715 |
+- * ->init_lock, no later/concurrent disksize_store() or any |
716 |
+- * other sysfs handlers are possible. |
717 |
+- */ |
718 |
+- sysfs_remove_group(&disk_to_dev(zram->disk)->kobj, |
719 |
+- &zram_disk_attr_group); |
720 |
+- |
721 |
+ /* Make sure all the pending I/O are finished */ |
722 |
+ fsync_bdev(bdev); |
723 |
+ zram_reset_device(zram); |
724 |
+diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig |
725 |
+index 4685bd10c473..ec6af1595062 100644 |
726 |
+--- a/drivers/bluetooth/Kconfig |
727 |
++++ b/drivers/bluetooth/Kconfig |
728 |
+@@ -125,7 +125,6 @@ config BT_HCIUART_LL |
729 |
+ config BT_HCIUART_3WIRE |
730 |
+ bool "Three-wire UART (H5) protocol support" |
731 |
+ depends on BT_HCIUART |
732 |
+- depends on BT_HCIUART_SERDEV |
733 |
+ help |
734 |
+ The HCI Three-wire UART Transport Layer makes it possible to |
735 |
+ user the Bluetooth HCI over a serial port interface. The HCI |
736 |
+diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c |
737 |
+index 389af3c15ec4..bde71b07f15e 100644 |
738 |
+--- a/drivers/clk/samsung/clk-exynos5420.c |
739 |
++++ b/drivers/clk/samsung/clk-exynos5420.c |
740 |
+@@ -273,6 +273,7 @@ static const struct samsung_clk_reg_dump exynos5420_set_clksrc[] = { |
741 |
+ { .offset = GATE_BUS_TOP, .value = 0xffffffff, }, |
742 |
+ { .offset = GATE_BUS_DISP1, .value = 0xffffffff, }, |
743 |
+ { .offset = GATE_IP_PERIC, .value = 0xffffffff, }, |
744 |
++ { .offset = GATE_IP_PERIS, .value = 0xffffffff, }, |
745 |
+ }; |
746 |
+ |
747 |
+ static int exynos5420_clk_suspend(void) |
748 |
+diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile |
749 |
+index 3c0467d3688c..88bd6829a358 100644 |
750 |
+--- a/drivers/firmware/efi/libstub/Makefile |
751 |
++++ b/drivers/firmware/efi/libstub/Makefile |
752 |
+@@ -10,7 +10,7 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 \ |
753 |
+ -fPIC -fno-strict-aliasing -mno-red-zone \ |
754 |
+ -mno-mmx -mno-sse -DDISABLE_BRANCH_PROFILING |
755 |
+ |
756 |
+-cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) |
757 |
++cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie |
758 |
+ cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \ |
759 |
+ -fno-builtin -fpic -mno-single-pic-base |
760 |
+ |
761 |
+diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c |
762 |
+index 78dfbd34b6bf..044efb779ed1 100644 |
763 |
+--- a/drivers/firmware/efi/libstub/arm64-stub.c |
764 |
++++ b/drivers/firmware/efi/libstub/arm64-stub.c |
765 |
+@@ -9,9 +9,17 @@ |
766 |
+ * published by the Free Software Foundation. |
767 |
+ * |
768 |
+ */ |
769 |
++ |
770 |
++/* |
771 |
++ * To prevent the compiler from emitting GOT-indirected (and thus absolute) |
772 |
++ * references to the section markers, override their visibility as 'hidden' |
773 |
++ */ |
774 |
++#pragma GCC visibility push(hidden) |
775 |
++#include <asm/sections.h> |
776 |
++#pragma GCC visibility pop |
777 |
++ |
778 |
+ #include <linux/efi.h> |
779 |
+ #include <asm/efi.h> |
780 |
+-#include <asm/sections.h> |
781 |
+ |
782 |
+ efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table_arg, |
783 |
+ unsigned long *image_addr, |
784 |
+diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c |
785 |
+index 1a2032c2c1fb..f6863adc15ad 100644 |
786 |
+--- a/drivers/hid/uhid.c |
787 |
++++ b/drivers/hid/uhid.c |
788 |
+@@ -12,6 +12,7 @@ |
789 |
+ |
790 |
+ #include <linux/atomic.h> |
791 |
+ #include <linux/compat.h> |
792 |
++#include <linux/cred.h> |
793 |
+ #include <linux/device.h> |
794 |
+ #include <linux/fs.h> |
795 |
+ #include <linux/hid.h> |
796 |
+@@ -24,6 +25,7 @@ |
797 |
+ #include <linux/spinlock.h> |
798 |
+ #include <linux/uhid.h> |
799 |
+ #include <linux/wait.h> |
800 |
++#include <linux/uaccess.h> |
801 |
+ |
802 |
+ #define UHID_NAME "uhid" |
803 |
+ #define UHID_BUFSIZE 32 |
804 |
+@@ -721,6 +723,17 @@ static ssize_t uhid_char_write(struct file *file, const char __user *buffer, |
805 |
+ |
806 |
+ switch (uhid->input_buf.type) { |
807 |
+ case UHID_CREATE: |
808 |
++ /* |
809 |
++ * 'struct uhid_create_req' contains a __user pointer which is |
810 |
++ * copied from, so it's unsafe to allow this with elevated |
811 |
++ * privileges (e.g. from a setuid binary) or via kernel_write(). |
812 |
++ */ |
813 |
++ if (file->f_cred != current_cred() || uaccess_kernel()) { |
814 |
++ pr_err_once("UHID_CREATE from different security context by process %d (%s), this is not allowed.\n", |
815 |
++ task_tgid_vnr(current), current->comm); |
816 |
++ ret = -EACCES; |
817 |
++ goto unlock; |
818 |
++ } |
819 |
+ ret = uhid_dev_create(uhid, &uhid->input_buf); |
820 |
+ break; |
821 |
+ case UHID_CREATE2: |
822 |
+diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c |
823 |
+index 55b5a8ff1cfe..ca3aa28977bc 100644 |
824 |
+--- a/drivers/hwmon/ibmpowernv.c |
825 |
++++ b/drivers/hwmon/ibmpowernv.c |
826 |
+@@ -114,7 +114,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *devattr, |
827 |
+ return sprintf(buf, "%s\n", sdata->label); |
828 |
+ } |
829 |
+ |
830 |
+-static int __init get_logical_cpu(int hwcpu) |
831 |
++static int get_logical_cpu(int hwcpu) |
832 |
+ { |
833 |
+ int cpu; |
834 |
+ |
835 |
+@@ -125,9 +125,8 @@ static int __init get_logical_cpu(int hwcpu) |
836 |
+ return -ENOENT; |
837 |
+ } |
838 |
+ |
839 |
+-static void __init make_sensor_label(struct device_node *np, |
840 |
+- struct sensor_data *sdata, |
841 |
+- const char *label) |
842 |
++static void make_sensor_label(struct device_node *np, |
843 |
++ struct sensor_data *sdata, const char *label) |
844 |
+ { |
845 |
+ u32 id; |
846 |
+ size_t n; |
847 |
+diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c |
848 |
+index b47ac4e053d0..f5c8a952f0aa 100644 |
849 |
+--- a/drivers/media/v4l2-core/v4l2-event.c |
850 |
++++ b/drivers/media/v4l2-core/v4l2-event.c |
851 |
+@@ -197,6 +197,22 @@ int v4l2_event_pending(struct v4l2_fh *fh) |
852 |
+ } |
853 |
+ EXPORT_SYMBOL_GPL(v4l2_event_pending); |
854 |
+ |
855 |
++static void __v4l2_event_unsubscribe(struct v4l2_subscribed_event *sev) |
856 |
++{ |
857 |
++ struct v4l2_fh *fh = sev->fh; |
858 |
++ unsigned int i; |
859 |
++ |
860 |
++ lockdep_assert_held(&fh->subscribe_lock); |
861 |
++ assert_spin_locked(&fh->vdev->fh_lock); |
862 |
++ |
863 |
++ /* Remove any pending events for this subscription */ |
864 |
++ for (i = 0; i < sev->in_use; i++) { |
865 |
++ list_del(&sev->events[sev_pos(sev, i)].list); |
866 |
++ fh->navailable--; |
867 |
++ } |
868 |
++ list_del(&sev->list); |
869 |
++} |
870 |
++ |
871 |
+ int v4l2_event_subscribe(struct v4l2_fh *fh, |
872 |
+ const struct v4l2_event_subscription *sub, unsigned elems, |
873 |
+ const struct v4l2_subscribed_event_ops *ops) |
874 |
+@@ -228,27 +244,23 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, |
875 |
+ |
876 |
+ spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
877 |
+ found_ev = v4l2_event_subscribed(fh, sub->type, sub->id); |
878 |
++ if (!found_ev) |
879 |
++ list_add(&sev->list, &fh->subscribed); |
880 |
+ spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
881 |
+ |
882 |
+ if (found_ev) { |
883 |
+ /* Already listening */ |
884 |
+ kfree(sev); |
885 |
+- goto out_unlock; |
886 |
+- } |
887 |
+- |
888 |
+- if (sev->ops && sev->ops->add) { |
889 |
++ } else if (sev->ops && sev->ops->add) { |
890 |
+ ret = sev->ops->add(sev, elems); |
891 |
+ if (ret) { |
892 |
++ spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
893 |
++ __v4l2_event_unsubscribe(sev); |
894 |
++ spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
895 |
+ kfree(sev); |
896 |
+- goto out_unlock; |
897 |
+ } |
898 |
+ } |
899 |
+ |
900 |
+- spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
901 |
+- list_add(&sev->list, &fh->subscribed); |
902 |
+- spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
903 |
+- |
904 |
+-out_unlock: |
905 |
+ mutex_unlock(&fh->subscribe_lock); |
906 |
+ |
907 |
+ return ret; |
908 |
+@@ -283,7 +295,6 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, |
909 |
+ { |
910 |
+ struct v4l2_subscribed_event *sev; |
911 |
+ unsigned long flags; |
912 |
+- int i; |
913 |
+ |
914 |
+ if (sub->type == V4L2_EVENT_ALL) { |
915 |
+ v4l2_event_unsubscribe_all(fh); |
916 |
+@@ -295,14 +306,8 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, |
917 |
+ spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
918 |
+ |
919 |
+ sev = v4l2_event_subscribed(fh, sub->type, sub->id); |
920 |
+- if (sev != NULL) { |
921 |
+- /* Remove any pending events for this subscription */ |
922 |
+- for (i = 0; i < sev->in_use; i++) { |
923 |
+- list_del(&sev->events[sev_pos(sev, i)].list); |
924 |
+- fh->navailable--; |
925 |
+- } |
926 |
+- list_del(&sev->list); |
927 |
+- } |
928 |
++ if (sev != NULL) |
929 |
++ __v4l2_event_unsubscribe(sev); |
930 |
+ |
931 |
+ spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
932 |
+ |
933 |
+diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c |
934 |
+index 1c37d5a78822..8ce9c63dfc59 100644 |
935 |
+--- a/drivers/media/v4l2-core/videobuf2-core.c |
936 |
++++ b/drivers/media/v4l2-core/videobuf2-core.c |
937 |
+@@ -870,12 +870,9 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) |
938 |
+ dprintk(4, "done processing on buffer %d, state: %d\n", |
939 |
+ vb->index, state); |
940 |
+ |
941 |
+- if (state != VB2_BUF_STATE_QUEUED && |
942 |
+- state != VB2_BUF_STATE_REQUEUEING) { |
943 |
+- /* sync buffers */ |
944 |
+- for (plane = 0; plane < vb->num_planes; ++plane) |
945 |
+- call_void_memop(vb, finish, vb->planes[plane].mem_priv); |
946 |
+- } |
947 |
++ /* sync buffers */ |
948 |
++ for (plane = 0; plane < vb->num_planes; ++plane) |
949 |
++ call_void_memop(vb, finish, vb->planes[plane].mem_priv); |
950 |
+ |
951 |
+ spin_lock_irqsave(&q->done_lock, flags); |
952 |
+ if (state == VB2_BUF_STATE_QUEUED || |
953 |
+diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c |
954 |
+index e11a0bd6c66e..e2474af7386a 100644 |
955 |
+--- a/drivers/misc/atmel-ssc.c |
956 |
++++ b/drivers/misc/atmel-ssc.c |
957 |
+@@ -129,7 +129,7 @@ static const struct of_device_id atmel_ssc_dt_ids[] = { |
958 |
+ MODULE_DEVICE_TABLE(of, atmel_ssc_dt_ids); |
959 |
+ #endif |
960 |
+ |
961 |
+-static inline const struct atmel_ssc_platform_data * __init |
962 |
++static inline const struct atmel_ssc_platform_data * |
963 |
+ atmel_ssc_get_driver_data(struct platform_device *pdev) |
964 |
+ { |
965 |
+ if (pdev->dev.of_node) { |
966 |
+diff --git a/drivers/misc/sgi-gru/grukdump.c b/drivers/misc/sgi-gru/grukdump.c |
967 |
+index 313da3150262..1540a7785e14 100644 |
968 |
+--- a/drivers/misc/sgi-gru/grukdump.c |
969 |
++++ b/drivers/misc/sgi-gru/grukdump.c |
970 |
+@@ -27,6 +27,9 @@ |
971 |
+ #include <linux/delay.h> |
972 |
+ #include <linux/bitops.h> |
973 |
+ #include <asm/uv/uv_hub.h> |
974 |
++ |
975 |
++#include <linux/nospec.h> |
976 |
++ |
977 |
+ #include "gru.h" |
978 |
+ #include "grutables.h" |
979 |
+ #include "gruhandles.h" |
980 |
+@@ -196,6 +199,7 @@ int gru_dump_chiplet_request(unsigned long arg) |
981 |
+ /* Currently, only dump by gid is implemented */ |
982 |
+ if (req.gid >= gru_max_gids) |
983 |
+ return -EINVAL; |
984 |
++ req.gid = array_index_nospec(req.gid, gru_max_gids); |
985 |
+ |
986 |
+ gru = GID_TO_GRU(req.gid); |
987 |
+ ubuf = req.buf; |
988 |
+diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c |
989 |
+index ce3a56bea6e6..58102e96ac5c 100644 |
990 |
+--- a/drivers/net/ethernet/broadcom/tg3.c |
991 |
++++ b/drivers/net/ethernet/broadcom/tg3.c |
992 |
+@@ -12379,6 +12379,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e |
993 |
+ { |
994 |
+ struct tg3 *tp = netdev_priv(dev); |
995 |
+ int i, irq_sync = 0, err = 0; |
996 |
++ bool reset_phy = false; |
997 |
+ |
998 |
+ if ((ering->rx_pending > tp->rx_std_ring_mask) || |
999 |
+ (ering->rx_jumbo_pending > tp->rx_jmb_ring_mask) || |
1000 |
+@@ -12410,7 +12411,13 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e |
1001 |
+ |
1002 |
+ if (netif_running(dev)) { |
1003 |
+ tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
1004 |
+- err = tg3_restart_hw(tp, false); |
1005 |
++ /* Reset PHY to avoid PHY lock up */ |
1006 |
++ if (tg3_asic_rev(tp) == ASIC_REV_5717 || |
1007 |
++ tg3_asic_rev(tp) == ASIC_REV_5719 || |
1008 |
++ tg3_asic_rev(tp) == ASIC_REV_5720) |
1009 |
++ reset_phy = true; |
1010 |
++ |
1011 |
++ err = tg3_restart_hw(tp, reset_phy); |
1012 |
+ if (!err) |
1013 |
+ tg3_netif_start(tp); |
1014 |
+ } |
1015 |
+@@ -12444,6 +12451,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam |
1016 |
+ { |
1017 |
+ struct tg3 *tp = netdev_priv(dev); |
1018 |
+ int err = 0; |
1019 |
++ bool reset_phy = false; |
1020 |
+ |
1021 |
+ if (tp->link_config.autoneg == AUTONEG_ENABLE) |
1022 |
+ tg3_warn_mgmt_link_flap(tp); |
1023 |
+@@ -12534,7 +12542,13 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam |
1024 |
+ |
1025 |
+ if (netif_running(dev)) { |
1026 |
+ tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
1027 |
+- err = tg3_restart_hw(tp, false); |
1028 |
++ /* Reset PHY to avoid PHY lock up */ |
1029 |
++ if (tg3_asic_rev(tp) == ASIC_REV_5717 || |
1030 |
++ tg3_asic_rev(tp) == ASIC_REV_5719 || |
1031 |
++ tg3_asic_rev(tp) == ASIC_REV_5720) |
1032 |
++ reset_phy = true; |
1033 |
++ |
1034 |
++ err = tg3_restart_hw(tp, reset_phy); |
1035 |
+ if (!err) |
1036 |
+ tg3_netif_start(tp); |
1037 |
+ } |
1038 |
+diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c |
1039 |
+index 460fa6708bfc..3c4b107aba78 100644 |
1040 |
+--- a/drivers/platform/x86/acerhdf.c |
1041 |
++++ b/drivers/platform/x86/acerhdf.c |
1042 |
+@@ -233,6 +233,7 @@ static const struct bios_settings bios_tbl[] = { |
1043 |
+ {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00}, 0}, |
1044 |
+ {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00}, 0}, |
1045 |
+ {"Gateway", "LT31", "v1.3303t", 0x55, 0x58, {0x9e, 0x00}, 0}, |
1046 |
++ {"Gateway", "LT31", "v1.3307", 0x55, 0x58, {0x9e, 0x00}, 0}, |
1047 |
+ /* Packard Bell */ |
1048 |
+ {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00}, 0}, |
1049 |
+ {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00}, 0}, |
1050 |
+diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c |
1051 |
+index 0ab15d833d1b..50fe1f76ea42 100644 |
1052 |
+--- a/drivers/uio/uio.c |
1053 |
++++ b/drivers/uio/uio.c |
1054 |
+@@ -842,6 +842,8 @@ int __uio_register_device(struct module *owner, |
1055 |
+ if (ret) |
1056 |
+ goto err_uio_dev_add_attributes; |
1057 |
+ |
1058 |
++ info->uio_dev = idev; |
1059 |
++ |
1060 |
+ if (info->irq && (info->irq != UIO_IRQ_CUSTOM)) { |
1061 |
+ /* |
1062 |
+ * Note that we deliberately don't use devm_request_irq |
1063 |
+@@ -853,11 +855,12 @@ int __uio_register_device(struct module *owner, |
1064 |
+ */ |
1065 |
+ ret = request_irq(info->irq, uio_interrupt, |
1066 |
+ info->irq_flags, info->name, idev); |
1067 |
+- if (ret) |
1068 |
++ if (ret) { |
1069 |
++ info->uio_dev = NULL; |
1070 |
+ goto err_request_irq; |
1071 |
++ } |
1072 |
+ } |
1073 |
+ |
1074 |
+- info->uio_dev = idev; |
1075 |
+ return 0; |
1076 |
+ |
1077 |
+ err_request_irq: |
1078 |
+diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c |
1079 |
+index 3cbf6aa10f2c..0a8e5ac891d4 100644 |
1080 |
+--- a/drivers/usb/class/cdc-acm.c |
1081 |
++++ b/drivers/usb/class/cdc-acm.c |
1082 |
+@@ -1716,6 +1716,9 @@ static const struct usb_device_id acm_ids[] = { |
1083 |
+ { USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */ |
1084 |
+ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
1085 |
+ }, |
1086 |
++ { USB_DEVICE(0x0572, 0x1349), /* Hiro (Conexant) USB MODEM H50228 */ |
1087 |
++ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
1088 |
++ }, |
1089 |
+ { USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */ |
1090 |
+ .driver_info = QUIRK_CONTROL_LINE_STATE, }, |
1091 |
+ { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */ |
1092 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1093 |
+index 37a5e07b3488..1e8f68960014 100644 |
1094 |
+--- a/drivers/usb/core/quirks.c |
1095 |
++++ b/drivers/usb/core/quirks.c |
1096 |
+@@ -243,6 +243,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1097 |
+ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT | |
1098 |
+ USB_QUIRK_DELAY_CTRL_MSG }, |
1099 |
+ |
1100 |
++ /* Corsair K70 LUX RGB */ |
1101 |
++ { USB_DEVICE(0x1b1c, 0x1b33), .driver_info = USB_QUIRK_DELAY_INIT }, |
1102 |
++ |
1103 |
+ /* Corsair K70 LUX */ |
1104 |
+ { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT }, |
1105 |
+ |
1106 |
+@@ -263,6 +266,11 @@ static const struct usb_device_id usb_quirk_list[] = { |
1107 |
+ { USB_DEVICE(0x2040, 0x7200), .driver_info = |
1108 |
+ USB_QUIRK_CONFIG_INTF_STRINGS }, |
1109 |
+ |
1110 |
++ /* Raydium Touchscreen */ |
1111 |
++ { USB_DEVICE(0x2386, 0x3114), .driver_info = USB_QUIRK_NO_LPM }, |
1112 |
++ |
1113 |
++ { USB_DEVICE(0x2386, 0x3119), .driver_info = USB_QUIRK_NO_LPM }, |
1114 |
++ |
1115 |
+ /* DJI CineSSD */ |
1116 |
+ { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, |
1117 |
+ |
1118 |
+diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c |
1119 |
+index f788f80fe1aa..aee29604bd79 100644 |
1120 |
+--- a/drivers/usb/host/xhci-hub.c |
1121 |
++++ b/drivers/usb/host/xhci-hub.c |
1122 |
+@@ -348,7 +348,7 @@ int xhci_find_slot_id_by_port(struct usb_hcd *hcd, struct xhci_hcd *xhci, |
1123 |
+ |
1124 |
+ slot_id = 0; |
1125 |
+ for (i = 0; i < MAX_HC_SLOTS; i++) { |
1126 |
+- if (!xhci->devs[i]) |
1127 |
++ if (!xhci->devs[i] || !xhci->devs[i]->udev) |
1128 |
+ continue; |
1129 |
+ speed = xhci->devs[i]->udev->speed; |
1130 |
+ if (((speed >= USB_SPEED_SUPER) == (hcd->speed >= HCD_USB3)) |
1131 |
+diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c |
1132 |
+index a0a3827b4aff..b15842c6f916 100644 |
1133 |
+--- a/drivers/usb/misc/appledisplay.c |
1134 |
++++ b/drivers/usb/misc/appledisplay.c |
1135 |
+@@ -63,6 +63,7 @@ static const struct usb_device_id appledisplay_table[] = { |
1136 |
+ { APPLEDISPLAY_DEVICE(0x9219) }, |
1137 |
+ { APPLEDISPLAY_DEVICE(0x921c) }, |
1138 |
+ { APPLEDISPLAY_DEVICE(0x921d) }, |
1139 |
++ { APPLEDISPLAY_DEVICE(0x9222) }, |
1140 |
+ { APPLEDISPLAY_DEVICE(0x9236) }, |
1141 |
+ |
1142 |
+ /* Terminating entry */ |
1143 |
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c |
1144 |
+index 8dbb00fbb00b..b0875ef48522 100644 |
1145 |
+--- a/fs/btrfs/disk-io.c |
1146 |
++++ b/fs/btrfs/disk-io.c |
1147 |
+@@ -4333,6 +4333,7 @@ static int btrfs_destroy_marked_extents(struct btrfs_root *root, |
1148 |
+ static int btrfs_destroy_pinned_extent(struct btrfs_root *root, |
1149 |
+ struct extent_io_tree *pinned_extents) |
1150 |
+ { |
1151 |
++ struct btrfs_fs_info *fs_info = root->fs_info; |
1152 |
+ struct extent_io_tree *unpin; |
1153 |
+ u64 start; |
1154 |
+ u64 end; |
1155 |
+@@ -4342,21 +4343,31 @@ static int btrfs_destroy_pinned_extent(struct btrfs_root *root, |
1156 |
+ unpin = pinned_extents; |
1157 |
+ again: |
1158 |
+ while (1) { |
1159 |
++ /* |
1160 |
++ * The btrfs_finish_extent_commit() may get the same range as |
1161 |
++ * ours between find_first_extent_bit and clear_extent_dirty. |
1162 |
++ * Hence, hold the unused_bg_unpin_mutex to avoid double unpin |
1163 |
++ * the same extent range. |
1164 |
++ */ |
1165 |
++ mutex_lock(&fs_info->unused_bg_unpin_mutex); |
1166 |
+ ret = find_first_extent_bit(unpin, 0, &start, &end, |
1167 |
+ EXTENT_DIRTY, NULL); |
1168 |
+- if (ret) |
1169 |
++ if (ret) { |
1170 |
++ mutex_unlock(&fs_info->unused_bg_unpin_mutex); |
1171 |
+ break; |
1172 |
++ } |
1173 |
+ |
1174 |
+ clear_extent_dirty(unpin, start, end, GFP_NOFS); |
1175 |
+ btrfs_error_unpin_extent_range(root, start, end); |
1176 |
++ mutex_unlock(&fs_info->unused_bg_unpin_mutex); |
1177 |
+ cond_resched(); |
1178 |
+ } |
1179 |
+ |
1180 |
+ if (loop) { |
1181 |
+- if (unpin == &root->fs_info->freed_extents[0]) |
1182 |
+- unpin = &root->fs_info->freed_extents[1]; |
1183 |
++ if (unpin == &fs_info->freed_extents[0]) |
1184 |
++ unpin = &fs_info->freed_extents[1]; |
1185 |
+ else |
1186 |
+- unpin = &root->fs_info->freed_extents[0]; |
1187 |
++ unpin = &fs_info->freed_extents[0]; |
1188 |
+ loop = false; |
1189 |
+ goto again; |
1190 |
+ } |
1191 |
+diff --git a/fs/exofs/super.c b/fs/exofs/super.c |
1192 |
+index b795c567b5e1..360ba74e04e6 100644 |
1193 |
+--- a/fs/exofs/super.c |
1194 |
++++ b/fs/exofs/super.c |
1195 |
+@@ -100,6 +100,7 @@ static int parse_options(char *options, struct exofs_mountopt *opts) |
1196 |
+ token = match_token(p, tokens, args); |
1197 |
+ switch (token) { |
1198 |
+ case Opt_name: |
1199 |
++ kfree(opts->dev_name); |
1200 |
+ opts->dev_name = match_strdup(&args[0]); |
1201 |
+ if (unlikely(!opts->dev_name)) { |
1202 |
+ EXOFS_ERR("Error allocating dev_name"); |
1203 |
+@@ -868,8 +869,10 @@ static struct dentry *exofs_mount(struct file_system_type *type, |
1204 |
+ int ret; |
1205 |
+ |
1206 |
+ ret = parse_options(data, &opts); |
1207 |
+- if (ret) |
1208 |
++ if (ret) { |
1209 |
++ kfree(opts.dev_name); |
1210 |
+ return ERR_PTR(ret); |
1211 |
++ } |
1212 |
+ |
1213 |
+ if (!opts.dev_name) |
1214 |
+ opts.dev_name = dev_name; |
1215 |
+diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c |
1216 |
+index c134c0462cee..ef24894edecc 100644 |
1217 |
+--- a/fs/gfs2/rgrp.c |
1218 |
++++ b/fs/gfs2/rgrp.c |
1219 |
+@@ -732,6 +732,7 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp) |
1220 |
+ spin_lock(&gl->gl_lockref.lock); |
1221 |
+ gl->gl_object = NULL; |
1222 |
+ spin_unlock(&gl->gl_lockref.lock); |
1223 |
++ gfs2_rgrp_brelse(rgd); |
1224 |
+ gfs2_glock_add_to_lru(gl); |
1225 |
+ gfs2_glock_put(gl); |
1226 |
+ } |
1227 |
+@@ -1139,7 +1140,7 @@ static u32 count_unlinked(struct gfs2_rgrpd *rgd) |
1228 |
+ * @rgd: the struct gfs2_rgrpd describing the RG to read in |
1229 |
+ * |
1230 |
+ * Read in all of a Resource Group's header and bitmap blocks. |
1231 |
+- * Caller must eventually call gfs2_rgrp_relse() to free the bitmaps. |
1232 |
++ * Caller must eventually call gfs2_rgrp_brelse() to free the bitmaps. |
1233 |
+ * |
1234 |
+ * Returns: errno |
1235 |
+ */ |
1236 |
+diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c |
1237 |
+index 2a6f3c67cb3f..2e713673df42 100644 |
1238 |
+--- a/fs/hfs/brec.c |
1239 |
++++ b/fs/hfs/brec.c |
1240 |
+@@ -424,6 +424,10 @@ skip: |
1241 |
+ if (new_node) { |
1242 |
+ __be32 cnid; |
1243 |
+ |
1244 |
++ if (!new_node->parent) { |
1245 |
++ hfs_btree_inc_height(tree); |
1246 |
++ new_node->parent = tree->root; |
1247 |
++ } |
1248 |
+ fd->bnode = hfs_bnode_find(tree, new_node->parent); |
1249 |
+ /* create index key and entry */ |
1250 |
+ hfs_bnode_read_key(new_node, fd->search_key, 14); |
1251 |
+diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c |
1252 |
+index 754fdf8c6356..1002a0c08319 100644 |
1253 |
+--- a/fs/hfsplus/brec.c |
1254 |
++++ b/fs/hfsplus/brec.c |
1255 |
+@@ -427,6 +427,10 @@ skip: |
1256 |
+ if (new_node) { |
1257 |
+ __be32 cnid; |
1258 |
+ |
1259 |
++ if (!new_node->parent) { |
1260 |
++ hfs_btree_inc_height(tree); |
1261 |
++ new_node->parent = tree->root; |
1262 |
++ } |
1263 |
+ fd->bnode = hfs_bnode_find(tree, new_node->parent); |
1264 |
+ /* create index key and entry */ |
1265 |
+ hfs_bnode_read_key(new_node, fd->search_key, 14); |
1266 |
+diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c |
1267 |
+index 8b32fdaad468..d424b3d4bf3b 100644 |
1268 |
+--- a/fs/reiserfs/xattr.c |
1269 |
++++ b/fs/reiserfs/xattr.c |
1270 |
+@@ -184,6 +184,7 @@ struct reiserfs_dentry_buf { |
1271 |
+ struct dir_context ctx; |
1272 |
+ struct dentry *xadir; |
1273 |
+ int count; |
1274 |
++ int err; |
1275 |
+ struct dentry *dentries[8]; |
1276 |
+ }; |
1277 |
+ |
1278 |
+@@ -206,6 +207,7 @@ fill_with_dentries(struct dir_context *ctx, const char *name, int namelen, |
1279 |
+ |
1280 |
+ dentry = lookup_one_len(name, dbuf->xadir, namelen); |
1281 |
+ if (IS_ERR(dentry)) { |
1282 |
++ dbuf->err = PTR_ERR(dentry); |
1283 |
+ return PTR_ERR(dentry); |
1284 |
+ } else if (d_really_is_negative(dentry)) { |
1285 |
+ /* A directory entry exists, but no file? */ |
1286 |
+@@ -214,6 +216,7 @@ fill_with_dentries(struct dir_context *ctx, const char *name, int namelen, |
1287 |
+ "not found for file %pd.\n", |
1288 |
+ dentry, dbuf->xadir); |
1289 |
+ dput(dentry); |
1290 |
++ dbuf->err = -EIO; |
1291 |
+ return -EIO; |
1292 |
+ } |
1293 |
+ |
1294 |
+@@ -261,6 +264,10 @@ static int reiserfs_for_each_xattr(struct inode *inode, |
1295 |
+ err = reiserfs_readdir_inode(d_inode(dir), &buf.ctx); |
1296 |
+ if (err) |
1297 |
+ break; |
1298 |
++ if (buf.err) { |
1299 |
++ err = buf.err; |
1300 |
++ break; |
1301 |
++ } |
1302 |
+ if (!buf.count) |
1303 |
+ break; |
1304 |
+ for (i = 0; !err && i < buf.count && buf.dentries[i]; i++) { |
1305 |
+diff --git a/include/linux/kbuild.h b/include/linux/kbuild.h |
1306 |
+index 22a72198c14b..4e80f3a9ad58 100644 |
1307 |
+--- a/include/linux/kbuild.h |
1308 |
++++ b/include/linux/kbuild.h |
1309 |
+@@ -2,14 +2,14 @@ |
1310 |
+ #define __LINUX_KBUILD_H |
1311 |
+ |
1312 |
+ #define DEFINE(sym, val) \ |
1313 |
+- asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
1314 |
++ asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val)) |
1315 |
+ |
1316 |
+-#define BLANK() asm volatile("\n->" : : ) |
1317 |
++#define BLANK() asm volatile("\n.ascii \"->\"" : : ) |
1318 |
+ |
1319 |
+ #define OFFSET(sym, str, mem) \ |
1320 |
+ DEFINE(sym, offsetof(struct str, mem)) |
1321 |
+ |
1322 |
+ #define COMMENT(x) \ |
1323 |
+- asm volatile("\n->#" x) |
1324 |
++ asm volatile("\n.ascii \"->#" x "\"") |
1325 |
+ |
1326 |
+ #endif |
1327 |
+diff --git a/include/linux/module.h b/include/linux/module.h |
1328 |
+index c9f2f85017ad..dfe5c2e25ba1 100644 |
1329 |
+--- a/include/linux/module.h |
1330 |
++++ b/include/linux/module.h |
1331 |
+@@ -125,13 +125,13 @@ extern void cleanup_module(void); |
1332 |
+ |
1333 |
+ /* Each module must use one module_init(). */ |
1334 |
+ #define module_init(initfn) \ |
1335 |
+- static inline initcall_t __inittest(void) \ |
1336 |
++ static inline initcall_t __maybe_unused __inittest(void) \ |
1337 |
+ { return initfn; } \ |
1338 |
+ int init_module(void) __attribute__((alias(#initfn))); |
1339 |
+ |
1340 |
+ /* This is only required if you want to be unloadable. */ |
1341 |
+ #define module_exit(exitfn) \ |
1342 |
+- static inline exitcall_t __exittest(void) \ |
1343 |
++ static inline exitcall_t __maybe_unused __exittest(void) \ |
1344 |
+ { return exitfn; } \ |
1345 |
+ void cleanup_module(void) __attribute__((alias(#exitfn))); |
1346 |
+ |
1347 |
+diff --git a/include/linux/netfilter/ipset/ip_set_comment.h b/include/linux/netfilter/ipset/ip_set_comment.h |
1348 |
+index 8d0248525957..9f34204978e4 100644 |
1349 |
+--- a/include/linux/netfilter/ipset/ip_set_comment.h |
1350 |
++++ b/include/linux/netfilter/ipset/ip_set_comment.h |
1351 |
+@@ -41,11 +41,11 @@ ip_set_init_comment(struct ip_set_comment *comment, |
1352 |
+ rcu_assign_pointer(comment->c, c); |
1353 |
+ } |
1354 |
+ |
1355 |
+-/* Used only when dumping a set, protected by rcu_read_lock_bh() */ |
1356 |
++/* Used only when dumping a set, protected by rcu_read_lock() */ |
1357 |
+ static inline int |
1358 |
+ ip_set_put_comment(struct sk_buff *skb, struct ip_set_comment *comment) |
1359 |
+ { |
1360 |
+- struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c); |
1361 |
++ struct ip_set_comment_rcu *c = rcu_dereference(comment->c); |
1362 |
+ |
1363 |
+ if (!c) |
1364 |
+ return 0; |
1365 |
+diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h |
1366 |
+index 558129af828a..15c7b5420d8a 100644 |
1367 |
+--- a/include/linux/uaccess.h |
1368 |
++++ b/include/linux/uaccess.h |
1369 |
+@@ -2,6 +2,9 @@ |
1370 |
+ #define __LINUX_UACCESS_H__ |
1371 |
+ |
1372 |
+ #include <linux/sched.h> |
1373 |
++ |
1374 |
++#define uaccess_kernel() segment_eq(get_fs(), KERNEL_DS) |
1375 |
++ |
1376 |
+ #include <asm/uaccess.h> |
1377 |
+ |
1378 |
+ static __always_inline void pagefault_disabled_inc(void) |
1379 |
+diff --git a/lib/raid6/test/Makefile b/lib/raid6/test/Makefile |
1380 |
+index 29090f3db677..28c089cb13f1 100644 |
1381 |
+--- a/lib/raid6/test/Makefile |
1382 |
++++ b/lib/raid6/test/Makefile |
1383 |
+@@ -26,7 +26,7 @@ ifeq ($(ARCH),arm) |
1384 |
+ CFLAGS += -I../../../arch/arm/include -mfpu=neon |
1385 |
+ HAS_NEON = yes |
1386 |
+ endif |
1387 |
+-ifeq ($(ARCH),arm64) |
1388 |
++ifeq ($(ARCH),aarch64) |
1389 |
+ CFLAGS += -I../../../arch/arm64/include |
1390 |
+ HAS_NEON = yes |
1391 |
+ endif |
1392 |
+@@ -37,7 +37,7 @@ ifeq ($(IS_X86),yes) |
1393 |
+ gcc -c -x assembler - >&/dev/null && \ |
1394 |
+ rm ./-.o && echo -DCONFIG_AS_AVX2=1) |
1395 |
+ else ifeq ($(HAS_NEON),yes) |
1396 |
+- OBJS += neon.o neon1.o neon2.o neon4.o neon8.o |
1397 |
++ OBJS += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o |
1398 |
+ CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1 |
1399 |
+ else |
1400 |
+ HAS_ALTIVEC := $(shell printf '\#include <altivec.h>\nvector int a;\n' |\ |
1401 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
1402 |
+index 7366feb8b5b3..e03c1d2f6707 100644 |
1403 |
+--- a/net/core/dev.c |
1404 |
++++ b/net/core/dev.c |
1405 |
+@@ -4481,6 +4481,10 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) |
1406 |
+ skb->vlan_tci = 0; |
1407 |
+ skb->dev = napi->dev; |
1408 |
+ skb->skb_iif = 0; |
1409 |
++ |
1410 |
++ /* eth_type_trans() assumes pkt_type is PACKET_HOST */ |
1411 |
++ skb->pkt_type = PACKET_HOST; |
1412 |
++ |
1413 |
+ skb->encapsulation = 0; |
1414 |
+ skb_shinfo(skb)->gso_type = 0; |
1415 |
+ skb->truesize = SKB_TRUESIZE(skb_end_offset(skb)); |
1416 |
+diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c |
1417 |
+index 4d14908afaec..697c4212129a 100644 |
1418 |
+--- a/net/core/flow_dissector.c |
1419 |
++++ b/net/core/flow_dissector.c |
1420 |
+@@ -480,8 +480,8 @@ ip_proto_again: |
1421 |
+ break; |
1422 |
+ } |
1423 |
+ |
1424 |
+- if (dissector_uses_key(flow_dissector, |
1425 |
+- FLOW_DISSECTOR_KEY_PORTS)) { |
1426 |
++ if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_PORTS) && |
1427 |
++ !(key_control->flags & FLOW_DIS_IS_FRAGMENT)) { |
1428 |
+ key_ports = skb_flow_dissector_target(flow_dissector, |
1429 |
+ FLOW_DISSECTOR_KEY_PORTS, |
1430 |
+ target_container); |
1431 |
+diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c |
1432 |
+index dbda0565781c..4916d1857b75 100644 |
1433 |
+--- a/net/ipv4/ip_tunnel_core.c |
1434 |
++++ b/net/ipv4/ip_tunnel_core.c |
1435 |
+@@ -71,7 +71,7 @@ int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, |
1436 |
+ |
1437 |
+ iph->version = 4; |
1438 |
+ iph->ihl = sizeof(struct iphdr) >> 2; |
1439 |
+- iph->frag_off = df; |
1440 |
++ iph->frag_off = ip_mtu_locked(&rt->dst) ? 0 : df; |
1441 |
+ iph->protocol = proto; |
1442 |
+ iph->tos = tos; |
1443 |
+ iph->daddr = dst; |
1444 |
+diff --git a/net/ipv6/route.c b/net/ipv6/route.c |
1445 |
+index 2f6d8f57fdd4..1cb8954885ec 100644 |
1446 |
+--- a/net/ipv6/route.c |
1447 |
++++ b/net/ipv6/route.c |
1448 |
+@@ -1420,8 +1420,12 @@ EXPORT_SYMBOL_GPL(ip6_update_pmtu); |
1449 |
+ |
1450 |
+ void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu) |
1451 |
+ { |
1452 |
+- ip6_update_pmtu(skb, sock_net(sk), mtu, |
1453 |
+- sk->sk_bound_dev_if, sk->sk_mark); |
1454 |
++ int oif = sk->sk_bound_dev_if; |
1455 |
++ |
1456 |
++ if (!oif && skb->dev) |
1457 |
++ oif = l3mdev_master_ifindex(skb->dev); |
1458 |
++ |
1459 |
++ ip6_update_pmtu(skb, sock_net(sk), mtu, oif, sk->sk_mark); |
1460 |
+ } |
1461 |
+ EXPORT_SYMBOL_GPL(ip6_sk_update_pmtu); |
1462 |
+ |
1463 |
+diff --git a/net/netfilter/ipset/ip_set_hash_netportnet.c b/net/netfilter/ipset/ip_set_hash_netportnet.c |
1464 |
+index 9a14c237830f..b259a5814965 100644 |
1465 |
+--- a/net/netfilter/ipset/ip_set_hash_netportnet.c |
1466 |
++++ b/net/netfilter/ipset/ip_set_hash_netportnet.c |
1467 |
+@@ -213,13 +213,13 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[], |
1468 |
+ |
1469 |
+ if (tb[IPSET_ATTR_CIDR]) { |
1470 |
+ e.cidr[0] = nla_get_u8(tb[IPSET_ATTR_CIDR]); |
1471 |
+- if (!e.cidr[0] || e.cidr[0] > HOST_MASK) |
1472 |
++ if (e.cidr[0] > HOST_MASK) |
1473 |
+ return -IPSET_ERR_INVALID_CIDR; |
1474 |
+ } |
1475 |
+ |
1476 |
+ if (tb[IPSET_ATTR_CIDR2]) { |
1477 |
+ e.cidr[1] = nla_get_u8(tb[IPSET_ATTR_CIDR2]); |
1478 |
+- if (!e.cidr[1] || e.cidr[1] > HOST_MASK) |
1479 |
++ if (e.cidr[1] > HOST_MASK) |
1480 |
+ return -IPSET_ERR_INVALID_CIDR; |
1481 |
+ } |
1482 |
+ |
1483 |
+@@ -492,13 +492,13 @@ hash_netportnet6_uadt(struct ip_set *set, struct nlattr *tb[], |
1484 |
+ |
1485 |
+ if (tb[IPSET_ATTR_CIDR]) { |
1486 |
+ e.cidr[0] = nla_get_u8(tb[IPSET_ATTR_CIDR]); |
1487 |
+- if (!e.cidr[0] || e.cidr[0] > HOST_MASK) |
1488 |
++ if (e.cidr[0] > HOST_MASK) |
1489 |
+ return -IPSET_ERR_INVALID_CIDR; |
1490 |
+ } |
1491 |
+ |
1492 |
+ if (tb[IPSET_ATTR_CIDR2]) { |
1493 |
+ e.cidr[1] = nla_get_u8(tb[IPSET_ATTR_CIDR2]); |
1494 |
+- if (!e.cidr[1] || e.cidr[1] > HOST_MASK) |
1495 |
++ if (e.cidr[1] > HOST_MASK) |
1496 |
+ return -IPSET_ERR_INVALID_CIDR; |
1497 |
+ } |
1498 |
+ |
1499 |
+diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c |
1500 |
+index 1718f536689f..8a1d2af3eed0 100644 |
1501 |
+--- a/net/netfilter/xt_IDLETIMER.c |
1502 |
++++ b/net/netfilter/xt_IDLETIMER.c |
1503 |
+@@ -116,6 +116,22 @@ static void idletimer_tg_expired(unsigned long data) |
1504 |
+ schedule_work(&timer->work); |
1505 |
+ } |
1506 |
+ |
1507 |
++static int idletimer_check_sysfs_name(const char *name, unsigned int size) |
1508 |
++{ |
1509 |
++ int ret; |
1510 |
++ |
1511 |
++ ret = xt_check_proc_name(name, size); |
1512 |
++ if (ret < 0) |
1513 |
++ return ret; |
1514 |
++ |
1515 |
++ if (!strcmp(name, "power") || |
1516 |
++ !strcmp(name, "subsystem") || |
1517 |
++ !strcmp(name, "uevent")) |
1518 |
++ return -EINVAL; |
1519 |
++ |
1520 |
++ return 0; |
1521 |
++} |
1522 |
++ |
1523 |
+ static int idletimer_tg_create(struct idletimer_tg_info *info) |
1524 |
+ { |
1525 |
+ int ret; |
1526 |
+@@ -126,6 +142,10 @@ static int idletimer_tg_create(struct idletimer_tg_info *info) |
1527 |
+ goto out; |
1528 |
+ } |
1529 |
+ |
1530 |
++ ret = idletimer_check_sysfs_name(info->label, sizeof(info->label)); |
1531 |
++ if (ret < 0) |
1532 |
++ goto out_free_timer; |
1533 |
++ |
1534 |
+ sysfs_attr_init(&info->timer->attr.attr); |
1535 |
+ info->timer->attr.attr.name = kstrdup(info->label, GFP_KERNEL); |
1536 |
+ if (!info->timer->attr.attr.name) { |
1537 |
+diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c |
1538 |
+index 9b8d855e4a87..ed9bbd383f7d 100644 |
1539 |
+--- a/net/sunrpc/xdr.c |
1540 |
++++ b/net/sunrpc/xdr.c |
1541 |
+@@ -512,7 +512,7 @@ EXPORT_SYMBOL_GPL(xdr_commit_encode); |
1542 |
+ static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr, |
1543 |
+ size_t nbytes) |
1544 |
+ { |
1545 |
+- static __be32 *p; |
1546 |
++ __be32 *p; |
1547 |
+ int space_left; |
1548 |
+ int frag1bytes, frag2bytes; |
1549 |
+ |
1550 |
+diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include |
1551 |
+index 5897fc3857a0..5e9cf7d146f0 100644 |
1552 |
+--- a/scripts/Kbuild.include |
1553 |
++++ b/scripts/Kbuild.include |
1554 |
+@@ -108,16 +108,21 @@ as-option = $(call try-run,\ |
1555 |
+ as-instr = $(call try-run,\ |
1556 |
+ printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) |
1557 |
+ |
1558 |
++# __cc-option |
1559 |
++# Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) |
1560 |
++__cc-option = $(call try-run,\ |
1561 |
++ $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4)) |
1562 |
++ |
1563 |
+ # cc-option |
1564 |
+ # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) |
1565 |
+ |
1566 |
+-cc-option = $(call try-run,\ |
1567 |
+- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) |
1568 |
++cc-option = $(call __cc-option, $(CC),\ |
1569 |
++ $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS),$(1),$(2)) |
1570 |
+ |
1571 |
+ # cc-option-yn |
1572 |
+ # Usage: flag := $(call cc-option-yn,-march=winchip-c6) |
1573 |
+ cc-option-yn = $(call try-run,\ |
1574 |
+- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) |
1575 |
++ $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) |
1576 |
+ |
1577 |
+ # cc-option-align |
1578 |
+ # Prefix align with either -falign or -malign |
1579 |
+@@ -127,7 +132,7 @@ cc-option-align = $(subst -functions=0,,\ |
1580 |
+ # cc-disable-warning |
1581 |
+ # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) |
1582 |
+ cc-disable-warning = $(call try-run,\ |
1583 |
+- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) |
1584 |
++ $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) |
1585 |
+ |
1586 |
+ # cc-name |
1587 |
+ # Expands to either gcc or clang |
1588 |
+@@ -147,12 +152,13 @@ cc-ifversion = $(shell [ $(cc-version) $(1) $(2) ] && echo $(3) || echo $(4)) |
1589 |
+ # cc-ldoption |
1590 |
+ # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) |
1591 |
+ cc-ldoption = $(call try-run,\ |
1592 |
+- $(CC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) |
1593 |
++ $(CC) $(1) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) |
1594 |
+ |
1595 |
+ # ld-option |
1596 |
+ # Usage: LDFLAGS += $(call ld-option, -X) |
1597 |
+ ld-option = $(call try-run,\ |
1598 |
+- $(CC) -x c /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) |
1599 |
++ $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -x c /dev/null -c -o "$$TMPO"; \ |
1600 |
++ $(LD) $(LDFLAGS) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) |
1601 |
+ |
1602 |
+ # ar-option |
1603 |
+ # Usage: KBUILD_ARFLAGS := $(call ar-option,D) |
1604 |
+diff --git a/scripts/Makefile.build b/scripts/Makefile.build |
1605 |
+index 18209917e379..42aef001dfdd 100644 |
1606 |
+--- a/scripts/Makefile.build |
1607 |
++++ b/scripts/Makefile.build |
1608 |
+@@ -175,6 +175,14 @@ cmd_cc_symtypes_c = \ |
1609 |
+ $(obj)/%.symtypes : $(src)/%.c FORCE |
1610 |
+ $(call cmd,cc_symtypes_c) |
1611 |
+ |
1612 |
++# LLVM assembly |
1613 |
++# Generate .ll files from .c |
1614 |
++quiet_cmd_cc_ll_c = CC $(quiet_modtag) $@ |
1615 |
++ cmd_cc_ll_c = $(CC) $(c_flags) -emit-llvm -S -o $@ $< |
1616 |
++ |
1617 |
++$(obj)/%.ll: $(src)/%.c FORCE |
1618 |
++ $(call if_changed_dep,cc_ll_c) |
1619 |
++ |
1620 |
+ # C (.c) files |
1621 |
+ # The C file is compiled and updated dependency information is generated. |
1622 |
+ # (See cmd_cc_o_c + relevant part of rule_cc_o_c) |
1623 |
+diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn |
1624 |
+index da3386a9d244..abe5f47b1ab0 100644 |
1625 |
+--- a/scripts/Makefile.extrawarn |
1626 |
++++ b/scripts/Makefile.extrawarn |
1627 |
+@@ -61,7 +61,6 @@ ifeq ($(cc-name),clang) |
1628 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) |
1629 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) |
1630 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, format) |
1631 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, unknown-warning-option) |
1632 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare) |
1633 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length) |
1634 |
+ KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized) |
1635 |
+diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib |
1636 |
+index a2d0e6d32659..27c56b5874f8 100644 |
1637 |
+--- a/scripts/Makefile.lib |
1638 |
++++ b/scripts/Makefile.lib |
1639 |
+@@ -388,3 +388,34 @@ quiet_cmd_xzmisc = XZMISC $@ |
1640 |
+ cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ |
1641 |
+ xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ |
1642 |
+ (rm -f $@ ; false) |
1643 |
++ |
1644 |
++# ASM offsets |
1645 |
++# --------------------------------------------------------------------------- |
1646 |
++ |
1647 |
++# Default sed regexp - multiline due to syntax constraints |
1648 |
++# |
1649 |
++# Use [:space:] because LLVM's integrated assembler inserts <tab> around |
1650 |
++# the .ascii directive whereas GCC keeps the <space> as-is. |
1651 |
++define sed-offsets |
1652 |
++ 's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; \ |
1653 |
++ /^->/{s:->#\(.*\):/* \1 */:; \ |
1654 |
++ s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ |
1655 |
++ s:->::; p;}' |
1656 |
++endef |
1657 |
++ |
1658 |
++# Use filechk to avoid rebuilds when a header changes, but the resulting file |
1659 |
++# does not |
1660 |
++define filechk_offsets |
1661 |
++ (set -e; \ |
1662 |
++ echo "#ifndef $2"; \ |
1663 |
++ echo "#define $2"; \ |
1664 |
++ echo "/*"; \ |
1665 |
++ echo " * DO NOT MODIFY."; \ |
1666 |
++ echo " *"; \ |
1667 |
++ echo " * This file was generated by Kbuild"; \ |
1668 |
++ echo " */"; \ |
1669 |
++ echo ""; \ |
1670 |
++ sed -ne $(sed-offsets); \ |
1671 |
++ echo ""; \ |
1672 |
++ echo "#endif" ) |
1673 |
++endef |
1674 |
+diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile |
1675 |
+index c11212ff3510..e0cb2e4a3b15 100644 |
1676 |
+--- a/scripts/mod/Makefile |
1677 |
++++ b/scripts/mod/Makefile |
1678 |
+@@ -5,32 +5,8 @@ modpost-objs := modpost.o file2alias.o sumversion.o |
1679 |
+ |
1680 |
+ devicetable-offsets-file := devicetable-offsets.h |
1681 |
+ |
1682 |
+-define sed-y |
1683 |
+- "/^->/{s:->#\(.*\):/* \1 */:; \ |
1684 |
+- s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ |
1685 |
+- s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ |
1686 |
+- s:->::; p;}" |
1687 |
+-endef |
1688 |
+- |
1689 |
+-quiet_cmd_offsets = GEN $@ |
1690 |
+-define cmd_offsets |
1691 |
+- (set -e; \ |
1692 |
+- echo "#ifndef __DEVICETABLE_OFFSETS_H__"; \ |
1693 |
+- echo "#define __DEVICETABLE_OFFSETS_H__"; \ |
1694 |
+- echo "/*"; \ |
1695 |
+- echo " * DO NOT MODIFY."; \ |
1696 |
+- echo " *"; \ |
1697 |
+- echo " * This file was generated by Kbuild"; \ |
1698 |
+- echo " *"; \ |
1699 |
+- echo " */"; \ |
1700 |
+- echo ""; \ |
1701 |
+- sed -ne $(sed-y) $<; \ |
1702 |
+- echo ""; \ |
1703 |
+- echo "#endif" ) > $@ |
1704 |
+-endef |
1705 |
+- |
1706 |
+-$(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s |
1707 |
+- $(call if_changed,offsets) |
1708 |
++$(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s FORCE |
1709 |
++ $(call filechk,offsets,__DEVICETABLE_OFFSETS_H__) |
1710 |
+ |
1711 |
+ targets += $(devicetable-offsets-file) devicetable-offsets.s |
1712 |
+ |