1 |
commit: d37109d7587a6faca28251272766319005a4c30b |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 25 13:45:54 2018 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 25 13:45:54 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d37109d7 |
7 |
|
8 |
linux kernel 4.15.6 |
9 |
|
10 |
0000_README | 4 + |
11 |
1005_linux-4.15.6.patch | 1556 +++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 1560 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index f22a6fe..828cfeb 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -63,6 +63,10 @@ Patch: 1004_linux-4.15.5.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.15.5 |
21 |
|
22 |
+Patch: 1005_linux-4.15.6.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.15.6 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1005_linux-4.15.6.patch b/1005_linux-4.15.6.patch |
31 |
new file mode 100644 |
32 |
index 0000000..dc80bb9 |
33 |
--- /dev/null |
34 |
+++ b/1005_linux-4.15.6.patch |
35 |
@@ -0,0 +1,1556 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index 28c537fbe328..51563c76bdf6 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,7 +1,7 @@ |
41 |
+ # SPDX-License-Identifier: GPL-2.0 |
42 |
+ VERSION = 4 |
43 |
+ PATCHLEVEL = 15 |
44 |
+-SUBLEVEL = 5 |
45 |
++SUBLEVEL = 6 |
46 |
+ EXTRAVERSION = |
47 |
+ NAME = Fearless Coyote |
48 |
+ |
49 |
+diff --git a/arch/arm/common/bL_switcher_dummy_if.c b/arch/arm/common/bL_switcher_dummy_if.c |
50 |
+index 4c10c6452678..f4dc1714a79e 100644 |
51 |
+--- a/arch/arm/common/bL_switcher_dummy_if.c |
52 |
++++ b/arch/arm/common/bL_switcher_dummy_if.c |
53 |
+@@ -57,3 +57,7 @@ static struct miscdevice bL_switcher_device = { |
54 |
+ &bL_switcher_fops |
55 |
+ }; |
56 |
+ module_misc_device(bL_switcher_device); |
57 |
++ |
58 |
++MODULE_AUTHOR("Nicolas Pitre <nico@××××××.org>"); |
59 |
++MODULE_LICENSE("GPL v2"); |
60 |
++MODULE_DESCRIPTION("big.LITTLE switcher dummy user interface"); |
61 |
+diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi |
62 |
+index 26396ef53bde..ea407aff1251 100644 |
63 |
+--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi |
64 |
++++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi |
65 |
+@@ -81,6 +81,7 @@ |
66 |
+ reg = <0x000>; |
67 |
+ enable-method = "psci"; |
68 |
+ cpu-idle-states = <&CPU_SLEEP_0>; |
69 |
++ #cooling-cells = <2>; |
70 |
+ }; |
71 |
+ |
72 |
+ cpu1: cpu@1 { |
73 |
+@@ -97,6 +98,7 @@ |
74 |
+ reg = <0x100>; |
75 |
+ enable-method = "psci"; |
76 |
+ cpu-idle-states = <&CPU_SLEEP_0>; |
77 |
++ #cooling-cells = <2>; |
78 |
+ }; |
79 |
+ |
80 |
+ cpu3: cpu@101 { |
81 |
+diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S |
82 |
+index 1c3b7ceb36d2..e7273a606a07 100644 |
83 |
+--- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S |
84 |
++++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S |
85 |
+@@ -55,29 +55,31 @@ |
86 |
+ #define RAB1bl %bl |
87 |
+ #define RAB2bl %cl |
88 |
+ |
89 |
++#define CD0 0x0(%rsp) |
90 |
++#define CD1 0x8(%rsp) |
91 |
++#define CD2 0x10(%rsp) |
92 |
++ |
93 |
++# used only before/after all rounds |
94 |
+ #define RCD0 %r8 |
95 |
+ #define RCD1 %r9 |
96 |
+ #define RCD2 %r10 |
97 |
+ |
98 |
+-#define RCD0d %r8d |
99 |
+-#define RCD1d %r9d |
100 |
+-#define RCD2d %r10d |
101 |
+- |
102 |
+-#define RX0 %rbp |
103 |
+-#define RX1 %r11 |
104 |
+-#define RX2 %r12 |
105 |
++# used only during rounds |
106 |
++#define RX0 %r8 |
107 |
++#define RX1 %r9 |
108 |
++#define RX2 %r10 |
109 |
+ |
110 |
+-#define RX0d %ebp |
111 |
+-#define RX1d %r11d |
112 |
+-#define RX2d %r12d |
113 |
++#define RX0d %r8d |
114 |
++#define RX1d %r9d |
115 |
++#define RX2d %r10d |
116 |
+ |
117 |
+-#define RY0 %r13 |
118 |
+-#define RY1 %r14 |
119 |
+-#define RY2 %r15 |
120 |
++#define RY0 %r11 |
121 |
++#define RY1 %r12 |
122 |
++#define RY2 %r13 |
123 |
+ |
124 |
+-#define RY0d %r13d |
125 |
+-#define RY1d %r14d |
126 |
+-#define RY2d %r15d |
127 |
++#define RY0d %r11d |
128 |
++#define RY1d %r12d |
129 |
++#define RY2d %r13d |
130 |
+ |
131 |
+ #define RT0 %rdx |
132 |
+ #define RT1 %rsi |
133 |
+@@ -85,6 +87,8 @@ |
134 |
+ #define RT0d %edx |
135 |
+ #define RT1d %esi |
136 |
+ |
137 |
++#define RT1bl %sil |
138 |
++ |
139 |
+ #define do16bit_ror(rot, op1, op2, T0, T1, tmp1, tmp2, ab, dst) \ |
140 |
+ movzbl ab ## bl, tmp2 ## d; \ |
141 |
+ movzbl ab ## bh, tmp1 ## d; \ |
142 |
+@@ -92,6 +96,11 @@ |
143 |
+ op1##l T0(CTX, tmp2, 4), dst ## d; \ |
144 |
+ op2##l T1(CTX, tmp1, 4), dst ## d; |
145 |
+ |
146 |
++#define swap_ab_with_cd(ab, cd, tmp) \ |
147 |
++ movq cd, tmp; \ |
148 |
++ movq ab, cd; \ |
149 |
++ movq tmp, ab; |
150 |
++ |
151 |
+ /* |
152 |
+ * Combined G1 & G2 function. Reordered with help of rotates to have moves |
153 |
+ * at begining. |
154 |
+@@ -110,15 +119,15 @@ |
155 |
+ /* G1,2 && G2,2 */ \ |
156 |
+ do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 0, x ## 0); \ |
157 |
+ do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 0, y ## 0); \ |
158 |
+- xchgq cd ## 0, ab ## 0; \ |
159 |
++ swap_ab_with_cd(ab ## 0, cd ## 0, RT0); \ |
160 |
+ \ |
161 |
+ do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 1, x ## 1); \ |
162 |
+ do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 1, y ## 1); \ |
163 |
+- xchgq cd ## 1, ab ## 1; \ |
164 |
++ swap_ab_with_cd(ab ## 1, cd ## 1, RT0); \ |
165 |
+ \ |
166 |
+ do16bit_ror(32, xor, xor, Tx2, Tx3, RT0, RT1, ab ## 2, x ## 2); \ |
167 |
+ do16bit_ror(16, xor, xor, Ty3, Ty0, RT0, RT1, ab ## 2, y ## 2); \ |
168 |
+- xchgq cd ## 2, ab ## 2; |
169 |
++ swap_ab_with_cd(ab ## 2, cd ## 2, RT0); |
170 |
+ |
171 |
+ #define enc_round_end(ab, x, y, n) \ |
172 |
+ addl y ## d, x ## d; \ |
173 |
+@@ -168,6 +177,16 @@ |
174 |
+ decrypt_round3(ba, dc, (n*2)+1); \ |
175 |
+ decrypt_round3(ba, dc, (n*2)); |
176 |
+ |
177 |
++#define push_cd() \ |
178 |
++ pushq RCD2; \ |
179 |
++ pushq RCD1; \ |
180 |
++ pushq RCD0; |
181 |
++ |
182 |
++#define pop_cd() \ |
183 |
++ popq RCD0; \ |
184 |
++ popq RCD1; \ |
185 |
++ popq RCD2; |
186 |
++ |
187 |
+ #define inpack3(in, n, xy, m) \ |
188 |
+ movq 4*(n)(in), xy ## 0; \ |
189 |
+ xorq w+4*m(CTX), xy ## 0; \ |
190 |
+@@ -223,11 +242,8 @@ ENTRY(__twofish_enc_blk_3way) |
191 |
+ * %rdx: src, RIO |
192 |
+ * %rcx: bool, if true: xor output |
193 |
+ */ |
194 |
+- pushq %r15; |
195 |
+- pushq %r14; |
196 |
+ pushq %r13; |
197 |
+ pushq %r12; |
198 |
+- pushq %rbp; |
199 |
+ pushq %rbx; |
200 |
+ |
201 |
+ pushq %rcx; /* bool xor */ |
202 |
+@@ -235,40 +251,36 @@ ENTRY(__twofish_enc_blk_3way) |
203 |
+ |
204 |
+ inpack_enc3(); |
205 |
+ |
206 |
+- encrypt_cycle3(RAB, RCD, 0); |
207 |
+- encrypt_cycle3(RAB, RCD, 1); |
208 |
+- encrypt_cycle3(RAB, RCD, 2); |
209 |
+- encrypt_cycle3(RAB, RCD, 3); |
210 |
+- encrypt_cycle3(RAB, RCD, 4); |
211 |
+- encrypt_cycle3(RAB, RCD, 5); |
212 |
+- encrypt_cycle3(RAB, RCD, 6); |
213 |
+- encrypt_cycle3(RAB, RCD, 7); |
214 |
++ push_cd(); |
215 |
++ encrypt_cycle3(RAB, CD, 0); |
216 |
++ encrypt_cycle3(RAB, CD, 1); |
217 |
++ encrypt_cycle3(RAB, CD, 2); |
218 |
++ encrypt_cycle3(RAB, CD, 3); |
219 |
++ encrypt_cycle3(RAB, CD, 4); |
220 |
++ encrypt_cycle3(RAB, CD, 5); |
221 |
++ encrypt_cycle3(RAB, CD, 6); |
222 |
++ encrypt_cycle3(RAB, CD, 7); |
223 |
++ pop_cd(); |
224 |
+ |
225 |
+ popq RIO; /* dst */ |
226 |
+- popq %rbp; /* bool xor */ |
227 |
++ popq RT1; /* bool xor */ |
228 |
+ |
229 |
+- testb %bpl, %bpl; |
230 |
++ testb RT1bl, RT1bl; |
231 |
+ jnz .L__enc_xor3; |
232 |
+ |
233 |
+ outunpack_enc3(mov); |
234 |
+ |
235 |
+ popq %rbx; |
236 |
+- popq %rbp; |
237 |
+ popq %r12; |
238 |
+ popq %r13; |
239 |
+- popq %r14; |
240 |
+- popq %r15; |
241 |
+ ret; |
242 |
+ |
243 |
+ .L__enc_xor3: |
244 |
+ outunpack_enc3(xor); |
245 |
+ |
246 |
+ popq %rbx; |
247 |
+- popq %rbp; |
248 |
+ popq %r12; |
249 |
+ popq %r13; |
250 |
+- popq %r14; |
251 |
+- popq %r15; |
252 |
+ ret; |
253 |
+ ENDPROC(__twofish_enc_blk_3way) |
254 |
+ |
255 |
+@@ -278,35 +290,31 @@ ENTRY(twofish_dec_blk_3way) |
256 |
+ * %rsi: dst |
257 |
+ * %rdx: src, RIO |
258 |
+ */ |
259 |
+- pushq %r15; |
260 |
+- pushq %r14; |
261 |
+ pushq %r13; |
262 |
+ pushq %r12; |
263 |
+- pushq %rbp; |
264 |
+ pushq %rbx; |
265 |
+ |
266 |
+ pushq %rsi; /* dst */ |
267 |
+ |
268 |
+ inpack_dec3(); |
269 |
+ |
270 |
+- decrypt_cycle3(RAB, RCD, 7); |
271 |
+- decrypt_cycle3(RAB, RCD, 6); |
272 |
+- decrypt_cycle3(RAB, RCD, 5); |
273 |
+- decrypt_cycle3(RAB, RCD, 4); |
274 |
+- decrypt_cycle3(RAB, RCD, 3); |
275 |
+- decrypt_cycle3(RAB, RCD, 2); |
276 |
+- decrypt_cycle3(RAB, RCD, 1); |
277 |
+- decrypt_cycle3(RAB, RCD, 0); |
278 |
++ push_cd(); |
279 |
++ decrypt_cycle3(RAB, CD, 7); |
280 |
++ decrypt_cycle3(RAB, CD, 6); |
281 |
++ decrypt_cycle3(RAB, CD, 5); |
282 |
++ decrypt_cycle3(RAB, CD, 4); |
283 |
++ decrypt_cycle3(RAB, CD, 3); |
284 |
++ decrypt_cycle3(RAB, CD, 2); |
285 |
++ decrypt_cycle3(RAB, CD, 1); |
286 |
++ decrypt_cycle3(RAB, CD, 0); |
287 |
++ pop_cd(); |
288 |
+ |
289 |
+ popq RIO; /* dst */ |
290 |
+ |
291 |
+ outunpack_dec3(); |
292 |
+ |
293 |
+ popq %rbx; |
294 |
+- popq %rbp; |
295 |
+ popq %r12; |
296 |
+ popq %r13; |
297 |
+- popq %r14; |
298 |
+- popq %r15; |
299 |
+ ret; |
300 |
+ ENDPROC(twofish_dec_blk_3way) |
301 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
302 |
+index ac381437c291..17f4eca37d22 100644 |
303 |
+--- a/arch/x86/kvm/x86.c |
304 |
++++ b/arch/x86/kvm/x86.c |
305 |
+@@ -2939,6 +2939,12 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) |
306 |
+ pagefault_enable(); |
307 |
+ kvm_x86_ops->vcpu_put(vcpu); |
308 |
+ vcpu->arch.last_host_tsc = rdtsc(); |
309 |
++ /* |
310 |
++ * If userspace has set any breakpoints or watchpoints, dr6 is restored |
311 |
++ * on every vmexit, but if not, we might have a stale dr6 from the |
312 |
++ * guest. do_debug expects dr6 to be cleared after it runs, do the same. |
313 |
++ */ |
314 |
++ set_debugreg(0, 6); |
315 |
+ } |
316 |
+ |
317 |
+ static int kvm_vcpu_ioctl_get_lapic(struct kvm_vcpu *vcpu, |
318 |
+diff --git a/block/blk-map.c b/block/blk-map.c |
319 |
+index d3a94719f03f..db9373bd31ac 100644 |
320 |
+--- a/block/blk-map.c |
321 |
++++ b/block/blk-map.c |
322 |
+@@ -119,7 +119,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, |
323 |
+ unsigned long align = q->dma_pad_mask | queue_dma_alignment(q); |
324 |
+ struct bio *bio = NULL; |
325 |
+ struct iov_iter i; |
326 |
+- int ret; |
327 |
++ int ret = -EINVAL; |
328 |
+ |
329 |
+ if (!iter_is_iovec(iter)) |
330 |
+ goto fail; |
331 |
+@@ -148,7 +148,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, |
332 |
+ __blk_rq_unmap_user(bio); |
333 |
+ fail: |
334 |
+ rq->bio = NULL; |
335 |
+- return -EINVAL; |
336 |
++ return ret; |
337 |
+ } |
338 |
+ EXPORT_SYMBOL(blk_rq_map_user_iov); |
339 |
+ |
340 |
+diff --git a/drivers/android/binder.c b/drivers/android/binder.c |
341 |
+index ec0917fb7cca..255eabdca2a4 100644 |
342 |
+--- a/drivers/android/binder.c |
343 |
++++ b/drivers/android/binder.c |
344 |
+@@ -1933,8 +1933,14 @@ static void binder_send_failed_reply(struct binder_transaction *t, |
345 |
+ &target_thread->todo); |
346 |
+ wake_up_interruptible(&target_thread->wait); |
347 |
+ } else { |
348 |
+- WARN(1, "Unexpected reply error: %u\n", |
349 |
+- target_thread->reply_error.cmd); |
350 |
++ /* |
351 |
++ * Cannot get here for normal operation, but |
352 |
++ * we can if multiple synchronous transactions |
353 |
++ * are sent without blocking for responses. |
354 |
++ * Just ignore the 2nd error in this case. |
355 |
++ */ |
356 |
++ pr_warn("Unexpected reply error: %u\n", |
357 |
++ target_thread->reply_error.cmd); |
358 |
+ } |
359 |
+ binder_inner_proc_unlock(target_thread->proc); |
360 |
+ binder_thread_dec_tmpref(target_thread); |
361 |
+@@ -2135,7 +2141,7 @@ static void binder_transaction_buffer_release(struct binder_proc *proc, |
362 |
+ int debug_id = buffer->debug_id; |
363 |
+ |
364 |
+ binder_debug(BINDER_DEBUG_TRANSACTION, |
365 |
+- "%d buffer release %d, size %zd-%zd, failed at %p\n", |
366 |
++ "%d buffer release %d, size %zd-%zd, failed at %pK\n", |
367 |
+ proc->pid, buffer->debug_id, |
368 |
+ buffer->data_size, buffer->offsets_size, failed_at); |
369 |
+ |
370 |
+@@ -3647,7 +3653,7 @@ static int binder_thread_write(struct binder_proc *proc, |
371 |
+ } |
372 |
+ } |
373 |
+ binder_debug(BINDER_DEBUG_DEAD_BINDER, |
374 |
+- "%d:%d BC_DEAD_BINDER_DONE %016llx found %p\n", |
375 |
++ "%d:%d BC_DEAD_BINDER_DONE %016llx found %pK\n", |
376 |
+ proc->pid, thread->pid, (u64)cookie, |
377 |
+ death); |
378 |
+ if (death == NULL) { |
379 |
+@@ -4316,6 +4322,15 @@ static int binder_thread_release(struct binder_proc *proc, |
380 |
+ |
381 |
+ binder_inner_proc_unlock(thread->proc); |
382 |
+ |
383 |
++ /* |
384 |
++ * This is needed to avoid races between wake_up_poll() above and |
385 |
++ * and ep_remove_waitqueue() called for other reasons (eg the epoll file |
386 |
++ * descriptor being closed); ep_remove_waitqueue() holds an RCU read |
387 |
++ * lock, so we can be sure it's done after calling synchronize_rcu(). |
388 |
++ */ |
389 |
++ if (thread->looper & BINDER_LOOPER_STATE_POLL) |
390 |
++ synchronize_rcu(); |
391 |
++ |
392 |
+ if (send_reply) |
393 |
+ binder_send_failed_reply(send_reply, BR_DEAD_REPLY); |
394 |
+ binder_release_work(proc, &thread->todo); |
395 |
+@@ -4331,6 +4346,8 @@ static unsigned int binder_poll(struct file *filp, |
396 |
+ bool wait_for_proc_work; |
397 |
+ |
398 |
+ thread = binder_get_thread(proc); |
399 |
++ if (!thread) |
400 |
++ return POLLERR; |
401 |
+ |
402 |
+ binder_inner_proc_lock(thread->proc); |
403 |
+ thread->looper |= BINDER_LOOPER_STATE_POLL; |
404 |
+@@ -4974,7 +4991,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m, |
405 |
+ spin_lock(&t->lock); |
406 |
+ to_proc = t->to_proc; |
407 |
+ seq_printf(m, |
408 |
+- "%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld r%d", |
409 |
++ "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld r%d", |
410 |
+ prefix, t->debug_id, t, |
411 |
+ t->from ? t->from->proc->pid : 0, |
412 |
+ t->from ? t->from->pid : 0, |
413 |
+@@ -4998,7 +5015,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m, |
414 |
+ } |
415 |
+ if (buffer->target_node) |
416 |
+ seq_printf(m, " node %d", buffer->target_node->debug_id); |
417 |
+- seq_printf(m, " size %zd:%zd data %p\n", |
418 |
++ seq_printf(m, " size %zd:%zd data %pK\n", |
419 |
+ buffer->data_size, buffer->offsets_size, |
420 |
+ buffer->data); |
421 |
+ } |
422 |
+diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c |
423 |
+index 142c6020cec7..5c0496d1ed41 100644 |
424 |
+--- a/drivers/crypto/s5p-sss.c |
425 |
++++ b/drivers/crypto/s5p-sss.c |
426 |
+@@ -1926,15 +1926,21 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode) |
427 |
+ uint32_t aes_control; |
428 |
+ unsigned long flags; |
429 |
+ int err; |
430 |
++ u8 *iv; |
431 |
+ |
432 |
+ aes_control = SSS_AES_KEY_CHANGE_MODE; |
433 |
+ if (mode & FLAGS_AES_DECRYPT) |
434 |
+ aes_control |= SSS_AES_MODE_DECRYPT; |
435 |
+ |
436 |
+- if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CBC) |
437 |
++ if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CBC) { |
438 |
+ aes_control |= SSS_AES_CHAIN_MODE_CBC; |
439 |
+- else if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CTR) |
440 |
++ iv = req->info; |
441 |
++ } else if ((mode & FLAGS_AES_MODE_MASK) == FLAGS_AES_CTR) { |
442 |
+ aes_control |= SSS_AES_CHAIN_MODE_CTR; |
443 |
++ iv = req->info; |
444 |
++ } else { |
445 |
++ iv = NULL; /* AES_ECB */ |
446 |
++ } |
447 |
+ |
448 |
+ if (dev->ctx->keylen == AES_KEYSIZE_192) |
449 |
+ aes_control |= SSS_AES_KEY_SIZE_192; |
450 |
+@@ -1965,7 +1971,7 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode) |
451 |
+ goto outdata_error; |
452 |
+ |
453 |
+ SSS_AES_WRITE(dev, AES_CONTROL, aes_control); |
454 |
+- s5p_set_aes(dev, dev->ctx->aes_key, req->info, dev->ctx->keylen); |
455 |
++ s5p_set_aes(dev, dev->ctx->aes_key, iv, dev->ctx->keylen); |
456 |
+ |
457 |
+ s5p_set_dma_indata(dev, dev->sg_src); |
458 |
+ s5p_set_dma_outdata(dev, dev->sg_dst); |
459 |
+diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c |
460 |
+index 8289ee482f49..09bd6c6c176c 100644 |
461 |
+--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c |
462 |
++++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c |
463 |
+@@ -3648,6 +3648,12 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw, |
464 |
+ hdw); |
465 |
+ hdw->ctl_write_urb->actual_length = 0; |
466 |
+ hdw->ctl_write_pend_flag = !0; |
467 |
++ if (usb_urb_ep_type_check(hdw->ctl_write_urb)) { |
468 |
++ pvr2_trace( |
469 |
++ PVR2_TRACE_ERROR_LEGS, |
470 |
++ "Invalid write control endpoint"); |
471 |
++ return -EINVAL; |
472 |
++ } |
473 |
+ status = usb_submit_urb(hdw->ctl_write_urb,GFP_KERNEL); |
474 |
+ if (status < 0) { |
475 |
+ pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
476 |
+@@ -3672,6 +3678,12 @@ status); |
477 |
+ hdw); |
478 |
+ hdw->ctl_read_urb->actual_length = 0; |
479 |
+ hdw->ctl_read_pend_flag = !0; |
480 |
++ if (usb_urb_ep_type_check(hdw->ctl_read_urb)) { |
481 |
++ pvr2_trace( |
482 |
++ PVR2_TRACE_ERROR_LEGS, |
483 |
++ "Invalid read control endpoint"); |
484 |
++ return -EINVAL; |
485 |
++ } |
486 |
+ status = usb_submit_urb(hdw->ctl_read_urb,GFP_KERNEL); |
487 |
+ if (status < 0) { |
488 |
+ pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
489 |
+diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h |
490 |
+index 0ccccbaf530d..e4b10b2d1a08 100644 |
491 |
+--- a/drivers/misc/mei/hw-me-regs.h |
492 |
++++ b/drivers/misc/mei/hw-me-regs.h |
493 |
+@@ -132,6 +132,11 @@ |
494 |
+ #define MEI_DEV_ID_KBP 0xA2BA /* Kaby Point */ |
495 |
+ #define MEI_DEV_ID_KBP_2 0xA2BB /* Kaby Point 2 */ |
496 |
+ |
497 |
++#define MEI_DEV_ID_CNP_LP 0x9DE0 /* Cannon Point LP */ |
498 |
++#define MEI_DEV_ID_CNP_LP_4 0x9DE4 /* Cannon Point LP 4 (iTouch) */ |
499 |
++#define MEI_DEV_ID_CNP_H 0xA360 /* Cannon Point H */ |
500 |
++#define MEI_DEV_ID_CNP_H_4 0xA364 /* Cannon Point H 4 (iTouch) */ |
501 |
++ |
502 |
+ /* |
503 |
+ * MEI HW Section |
504 |
+ */ |
505 |
+diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c |
506 |
+index 4a0ccda4d04b..ea4e152270a3 100644 |
507 |
+--- a/drivers/misc/mei/pci-me.c |
508 |
++++ b/drivers/misc/mei/pci-me.c |
509 |
+@@ -98,6 +98,11 @@ static const struct pci_device_id mei_me_pci_tbl[] = { |
510 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)}, |
511 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_KBP_2, MEI_ME_PCH8_CFG)}, |
512 |
+ |
513 |
++ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP, MEI_ME_PCH8_CFG)}, |
514 |
++ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_LP_4, MEI_ME_PCH8_CFG)}, |
515 |
++ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H, MEI_ME_PCH8_CFG)}, |
516 |
++ {MEI_PCI_DEVICE(MEI_DEV_ID_CNP_H_4, MEI_ME_PCH8_CFG)}, |
517 |
++ |
518 |
+ /* required last entry */ |
519 |
+ {0, } |
520 |
+ }; |
521 |
+diff --git a/drivers/net/tun.c b/drivers/net/tun.c |
522 |
+index a8ec589d1359..e29cd5c7d39f 100644 |
523 |
+--- a/drivers/net/tun.c |
524 |
++++ b/drivers/net/tun.c |
525 |
+@@ -1317,27 +1317,23 @@ static struct sk_buff *tun_napi_alloc_frags(struct tun_file *tfile, |
526 |
+ skb->truesize += skb->data_len; |
527 |
+ |
528 |
+ for (i = 1; i < it->nr_segs; i++) { |
529 |
++ struct page_frag *pfrag = ¤t->task_frag; |
530 |
+ size_t fragsz = it->iov[i].iov_len; |
531 |
+- unsigned long offset; |
532 |
+- struct page *page; |
533 |
+- void *data; |
534 |
+ |
535 |
+ if (fragsz == 0 || fragsz > PAGE_SIZE) { |
536 |
+ err = -EINVAL; |
537 |
+ goto free; |
538 |
+ } |
539 |
+ |
540 |
+- local_bh_disable(); |
541 |
+- data = napi_alloc_frag(fragsz); |
542 |
+- local_bh_enable(); |
543 |
+- if (!data) { |
544 |
++ if (!skb_page_frag_refill(fragsz, pfrag, GFP_KERNEL)) { |
545 |
+ err = -ENOMEM; |
546 |
+ goto free; |
547 |
+ } |
548 |
+ |
549 |
+- page = virt_to_head_page(data); |
550 |
+- offset = data - page_address(page); |
551 |
+- skb_fill_page_desc(skb, i - 1, page, offset, fragsz); |
552 |
++ skb_fill_page_desc(skb, i - 1, pfrag->page, |
553 |
++ pfrag->offset, fragsz); |
554 |
++ page_ref_inc(pfrag->page); |
555 |
++ pfrag->offset += fragsz; |
556 |
+ } |
557 |
+ |
558 |
+ return skb; |
559 |
+diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c |
560 |
+index ce35ff748adf..0a43b2e8906f 100644 |
561 |
+--- a/drivers/soc/qcom/rmtfs_mem.c |
562 |
++++ b/drivers/soc/qcom/rmtfs_mem.c |
563 |
+@@ -267,3 +267,7 @@ static void qcom_rmtfs_mem_exit(void) |
564 |
+ unregister_chrdev_region(qcom_rmtfs_mem_major, QCOM_RMTFS_MEM_DEV_MAX); |
565 |
+ } |
566 |
+ module_exit(qcom_rmtfs_mem_exit); |
567 |
++ |
568 |
++MODULE_AUTHOR("Linaro Ltd"); |
569 |
++MODULE_DESCRIPTION("Qualcomm Remote Filesystem memory driver"); |
570 |
++MODULE_LICENSE("GPL v2"); |
571 |
+diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c |
572 |
+index 372ce9913e6d..e7541dc90473 100644 |
573 |
+--- a/drivers/staging/android/ashmem.c |
574 |
++++ b/drivers/staging/android/ashmem.c |
575 |
+@@ -710,30 +710,32 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd, |
576 |
+ size_t pgstart, pgend; |
577 |
+ int ret = -EINVAL; |
578 |
+ |
579 |
++ mutex_lock(&ashmem_mutex); |
580 |
++ |
581 |
+ if (unlikely(!asma->file)) |
582 |
+- return -EINVAL; |
583 |
++ goto out_unlock; |
584 |
+ |
585 |
+- if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) |
586 |
+- return -EFAULT; |
587 |
++ if (unlikely(copy_from_user(&pin, p, sizeof(pin)))) { |
588 |
++ ret = -EFAULT; |
589 |
++ goto out_unlock; |
590 |
++ } |
591 |
+ |
592 |
+ /* per custom, you can pass zero for len to mean "everything onward" */ |
593 |
+ if (!pin.len) |
594 |
+ pin.len = PAGE_ALIGN(asma->size) - pin.offset; |
595 |
+ |
596 |
+ if (unlikely((pin.offset | pin.len) & ~PAGE_MASK)) |
597 |
+- return -EINVAL; |
598 |
++ goto out_unlock; |
599 |
+ |
600 |
+ if (unlikely(((__u32)-1) - pin.offset < pin.len)) |
601 |
+- return -EINVAL; |
602 |
++ goto out_unlock; |
603 |
+ |
604 |
+ if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len)) |
605 |
+- return -EINVAL; |
606 |
++ goto out_unlock; |
607 |
+ |
608 |
+ pgstart = pin.offset / PAGE_SIZE; |
609 |
+ pgend = pgstart + (pin.len / PAGE_SIZE) - 1; |
610 |
+ |
611 |
+- mutex_lock(&ashmem_mutex); |
612 |
+- |
613 |
+ switch (cmd) { |
614 |
+ case ASHMEM_PIN: |
615 |
+ ret = ashmem_pin(asma, pgstart, pgend); |
616 |
+@@ -746,6 +748,7 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd, |
617 |
+ break; |
618 |
+ } |
619 |
+ |
620 |
++out_unlock: |
621 |
+ mutex_unlock(&ashmem_mutex); |
622 |
+ |
623 |
+ return ret; |
624 |
+diff --git a/drivers/staging/android/ion/ion-ioctl.c b/drivers/staging/android/ion/ion-ioctl.c |
625 |
+index c78989351f9c..6cfed48f376e 100644 |
626 |
+--- a/drivers/staging/android/ion/ion-ioctl.c |
627 |
++++ b/drivers/staging/android/ion/ion-ioctl.c |
628 |
+@@ -70,8 +70,10 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
629 |
+ return -EFAULT; |
630 |
+ |
631 |
+ ret = validate_ioctl_arg(cmd, &data); |
632 |
+- if (WARN_ON_ONCE(ret)) |
633 |
++ if (ret) { |
634 |
++ pr_warn_once("%s: ioctl validate failed\n", __func__); |
635 |
+ return ret; |
636 |
++ } |
637 |
+ |
638 |
+ if (!(dir & _IOC_WRITE)) |
639 |
+ memset(&data, 0, sizeof(data)); |
640 |
+diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c |
641 |
+index 4dc5d7a589c2..b6ece18e6a88 100644 |
642 |
+--- a/drivers/staging/android/ion/ion_system_heap.c |
643 |
++++ b/drivers/staging/android/ion/ion_system_heap.c |
644 |
+@@ -371,7 +371,7 @@ static int ion_system_contig_heap_allocate(struct ion_heap *heap, |
645 |
+ unsigned long i; |
646 |
+ int ret; |
647 |
+ |
648 |
+- page = alloc_pages(low_order_gfp_flags, order); |
649 |
++ page = alloc_pages(low_order_gfp_flags | __GFP_NOWARN, order); |
650 |
+ if (!page) |
651 |
+ return -ENOMEM; |
652 |
+ |
653 |
+diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig |
654 |
+index 504c987447f2..eee1c1b277fa 100644 |
655 |
+--- a/drivers/staging/fsl-mc/bus/Kconfig |
656 |
++++ b/drivers/staging/fsl-mc/bus/Kconfig |
657 |
+@@ -8,7 +8,7 @@ |
658 |
+ |
659 |
+ config FSL_MC_BUS |
660 |
+ bool "QorIQ DPAA2 fsl-mc bus driver" |
661 |
+- depends on OF && (ARCH_LAYERSCAPE || (COMPILE_TEST && (ARM || ARM64 || X86 || PPC))) |
662 |
++ depends on OF && (ARCH_LAYERSCAPE || (COMPILE_TEST && (ARM || ARM64 || X86_LOCAL_APIC || PPC))) |
663 |
+ select GENERIC_MSI_IRQ_DOMAIN |
664 |
+ help |
665 |
+ Driver to enable the bus infrastructure for the QorIQ DPAA2 |
666 |
+diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c |
667 |
+index cadfb96734ed..d4da2807eb55 100644 |
668 |
+--- a/drivers/staging/iio/adc/ad7192.c |
669 |
++++ b/drivers/staging/iio/adc/ad7192.c |
670 |
+@@ -141,6 +141,8 @@ |
671 |
+ #define AD7192_GPOCON_P1DAT BIT(1) /* P1 state */ |
672 |
+ #define AD7192_GPOCON_P0DAT BIT(0) /* P0 state */ |
673 |
+ |
674 |
++#define AD7192_EXT_FREQ_MHZ_MIN 2457600 |
675 |
++#define AD7192_EXT_FREQ_MHZ_MAX 5120000 |
676 |
+ #define AD7192_INT_FREQ_MHZ 4915200 |
677 |
+ |
678 |
+ /* NOTE: |
679 |
+@@ -218,6 +220,12 @@ static int ad7192_calibrate_all(struct ad7192_state *st) |
680 |
+ ARRAY_SIZE(ad7192_calib_arr)); |
681 |
+ } |
682 |
+ |
683 |
++static inline bool ad7192_valid_external_frequency(u32 freq) |
684 |
++{ |
685 |
++ return (freq >= AD7192_EXT_FREQ_MHZ_MIN && |
686 |
++ freq <= AD7192_EXT_FREQ_MHZ_MAX); |
687 |
++} |
688 |
++ |
689 |
+ static int ad7192_setup(struct ad7192_state *st, |
690 |
+ const struct ad7192_platform_data *pdata) |
691 |
+ { |
692 |
+@@ -243,17 +251,20 @@ static int ad7192_setup(struct ad7192_state *st, |
693 |
+ id); |
694 |
+ |
695 |
+ switch (pdata->clock_source_sel) { |
696 |
+- case AD7192_CLK_EXT_MCLK1_2: |
697 |
+- case AD7192_CLK_EXT_MCLK2: |
698 |
+- st->mclk = AD7192_INT_FREQ_MHZ; |
699 |
+- break; |
700 |
+ case AD7192_CLK_INT: |
701 |
+ case AD7192_CLK_INT_CO: |
702 |
+- if (pdata->ext_clk_hz) |
703 |
+- st->mclk = pdata->ext_clk_hz; |
704 |
+- else |
705 |
+- st->mclk = AD7192_INT_FREQ_MHZ; |
706 |
++ st->mclk = AD7192_INT_FREQ_MHZ; |
707 |
+ break; |
708 |
++ case AD7192_CLK_EXT_MCLK1_2: |
709 |
++ case AD7192_CLK_EXT_MCLK2: |
710 |
++ if (ad7192_valid_external_frequency(pdata->ext_clk_hz)) { |
711 |
++ st->mclk = pdata->ext_clk_hz; |
712 |
++ break; |
713 |
++ } |
714 |
++ dev_err(&st->sd.spi->dev, "Invalid frequency setting %u\n", |
715 |
++ pdata->ext_clk_hz); |
716 |
++ ret = -EINVAL; |
717 |
++ goto out; |
718 |
+ default: |
719 |
+ ret = -EINVAL; |
720 |
+ goto out; |
721 |
+diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c |
722 |
+index 2b28fb9c0048..3bcf49466361 100644 |
723 |
+--- a/drivers/staging/iio/impedance-analyzer/ad5933.c |
724 |
++++ b/drivers/staging/iio/impedance-analyzer/ad5933.c |
725 |
+@@ -648,8 +648,6 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev) |
726 |
+ /* Ring buffer functions - here trigger setup related */ |
727 |
+ indio_dev->setup_ops = &ad5933_ring_setup_ops; |
728 |
+ |
729 |
+- indio_dev->modes |= INDIO_BUFFER_HARDWARE; |
730 |
+- |
731 |
+ return 0; |
732 |
+ } |
733 |
+ |
734 |
+@@ -762,7 +760,7 @@ static int ad5933_probe(struct i2c_client *client, |
735 |
+ indio_dev->dev.parent = &client->dev; |
736 |
+ indio_dev->info = &ad5933_info; |
737 |
+ indio_dev->name = id->name; |
738 |
+- indio_dev->modes = INDIO_DIRECT_MODE; |
739 |
++ indio_dev->modes = (INDIO_BUFFER_SOFTWARE | INDIO_DIRECT_MODE); |
740 |
+ indio_dev->channels = ad5933_channels; |
741 |
+ indio_dev->num_channels = ARRAY_SIZE(ad5933_channels); |
742 |
+ |
743 |
+diff --git a/drivers/usb/host/xhci-debugfs.c b/drivers/usb/host/xhci-debugfs.c |
744 |
+index e26e685d8a57..5851052d4668 100644 |
745 |
+--- a/drivers/usb/host/xhci-debugfs.c |
746 |
++++ b/drivers/usb/host/xhci-debugfs.c |
747 |
+@@ -211,7 +211,7 @@ static void xhci_ring_dump_segment(struct seq_file *s, |
748 |
+ static int xhci_ring_trb_show(struct seq_file *s, void *unused) |
749 |
+ { |
750 |
+ int i; |
751 |
+- struct xhci_ring *ring = s->private; |
752 |
++ struct xhci_ring *ring = *(struct xhci_ring **)s->private; |
753 |
+ struct xhci_segment *seg = ring->first_seg; |
754 |
+ |
755 |
+ for (i = 0; i < ring->num_segs; i++) { |
756 |
+@@ -387,7 +387,7 @@ void xhci_debugfs_create_endpoint(struct xhci_hcd *xhci, |
757 |
+ |
758 |
+ snprintf(epriv->name, sizeof(epriv->name), "ep%02d", ep_index); |
759 |
+ epriv->root = xhci_debugfs_create_ring_dir(xhci, |
760 |
+- &dev->eps[ep_index].new_ring, |
761 |
++ &dev->eps[ep_index].ring, |
762 |
+ epriv->name, |
763 |
+ spriv->root); |
764 |
+ spriv->eps[ep_index] = epriv; |
765 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
766 |
+index da6dbe3ebd8b..5c1326154e66 100644 |
767 |
+--- a/drivers/usb/host/xhci.c |
768 |
++++ b/drivers/usb/host/xhci.c |
769 |
+@@ -652,8 +652,6 @@ static void xhci_stop(struct usb_hcd *hcd) |
770 |
+ return; |
771 |
+ } |
772 |
+ |
773 |
+- xhci_debugfs_exit(xhci); |
774 |
+- |
775 |
+ spin_lock_irq(&xhci->lock); |
776 |
+ xhci->xhc_state |= XHCI_STATE_HALTED; |
777 |
+ xhci->cmd_ring_state = CMD_RING_STATE_STOPPED; |
778 |
+@@ -685,6 +683,7 @@ static void xhci_stop(struct usb_hcd *hcd) |
779 |
+ |
780 |
+ xhci_dbg_trace(xhci, trace_xhci_dbg_init, "cleaning up memory"); |
781 |
+ xhci_mem_cleanup(xhci); |
782 |
++ xhci_debugfs_exit(xhci); |
783 |
+ xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
784 |
+ "xhci_stop completed - status = %x", |
785 |
+ readl(&xhci->op_regs->status)); |
786 |
+@@ -1018,6 +1017,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
787 |
+ |
788 |
+ xhci_dbg(xhci, "cleaning up memory\n"); |
789 |
+ xhci_mem_cleanup(xhci); |
790 |
++ xhci_debugfs_exit(xhci); |
791 |
+ xhci_dbg(xhci, "xhci_stop completed - status = %x\n", |
792 |
+ readl(&xhci->op_regs->status)); |
793 |
+ |
794 |
+@@ -3551,12 +3551,10 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev) |
795 |
+ virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING; |
796 |
+ del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); |
797 |
+ } |
798 |
+- |
799 |
++ xhci_debugfs_remove_slot(xhci, udev->slot_id); |
800 |
+ ret = xhci_disable_slot(xhci, udev->slot_id); |
801 |
+- if (ret) { |
802 |
+- xhci_debugfs_remove_slot(xhci, udev->slot_id); |
803 |
++ if (ret) |
804 |
+ xhci_free_virt_device(xhci, udev->slot_id); |
805 |
+- } |
806 |
+ } |
807 |
+ |
808 |
+ int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id) |
809 |
+diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c |
810 |
+index e31a6f204397..86037e5b1101 100644 |
811 |
+--- a/drivers/usb/usbip/stub_dev.c |
812 |
++++ b/drivers/usb/usbip/stub_dev.c |
813 |
+@@ -73,6 +73,7 @@ static ssize_t store_sockfd(struct device *dev, struct device_attribute *attr, |
814 |
+ goto err; |
815 |
+ |
816 |
+ sdev->ud.tcp_socket = socket; |
817 |
++ sdev->ud.sockfd = sockfd; |
818 |
+ |
819 |
+ spin_unlock_irq(&sdev->ud.lock); |
820 |
+ |
821 |
+@@ -172,6 +173,7 @@ static void stub_shutdown_connection(struct usbip_device *ud) |
822 |
+ if (ud->tcp_socket) { |
823 |
+ sockfd_put(ud->tcp_socket); |
824 |
+ ud->tcp_socket = NULL; |
825 |
++ ud->sockfd = -1; |
826 |
+ } |
827 |
+ |
828 |
+ /* 3. free used data */ |
829 |
+@@ -266,6 +268,7 @@ static struct stub_device *stub_device_alloc(struct usb_device *udev) |
830 |
+ sdev->ud.status = SDEV_ST_AVAILABLE; |
831 |
+ spin_lock_init(&sdev->ud.lock); |
832 |
+ sdev->ud.tcp_socket = NULL; |
833 |
++ sdev->ud.sockfd = -1; |
834 |
+ |
835 |
+ INIT_LIST_HEAD(&sdev->priv_init); |
836 |
+ INIT_LIST_HEAD(&sdev->priv_tx); |
837 |
+diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c |
838 |
+index c3e1008aa491..20e3d4609583 100644 |
839 |
+--- a/drivers/usb/usbip/vhci_hcd.c |
840 |
++++ b/drivers/usb/usbip/vhci_hcd.c |
841 |
+@@ -984,6 +984,7 @@ static void vhci_shutdown_connection(struct usbip_device *ud) |
842 |
+ if (vdev->ud.tcp_socket) { |
843 |
+ sockfd_put(vdev->ud.tcp_socket); |
844 |
+ vdev->ud.tcp_socket = NULL; |
845 |
++ vdev->ud.sockfd = -1; |
846 |
+ } |
847 |
+ pr_info("release socket\n"); |
848 |
+ |
849 |
+@@ -1030,6 +1031,7 @@ static void vhci_device_reset(struct usbip_device *ud) |
850 |
+ if (ud->tcp_socket) { |
851 |
+ sockfd_put(ud->tcp_socket); |
852 |
+ ud->tcp_socket = NULL; |
853 |
++ ud->sockfd = -1; |
854 |
+ } |
855 |
+ ud->status = VDEV_ST_NULL; |
856 |
+ |
857 |
+diff --git a/drivers/video/fbdev/mmp/core.c b/drivers/video/fbdev/mmp/core.c |
858 |
+index a0f496049db7..3a6bb6561ba0 100644 |
859 |
+--- a/drivers/video/fbdev/mmp/core.c |
860 |
++++ b/drivers/video/fbdev/mmp/core.c |
861 |
+@@ -23,6 +23,7 @@ |
862 |
+ #include <linux/slab.h> |
863 |
+ #include <linux/dma-mapping.h> |
864 |
+ #include <linux/export.h> |
865 |
++#include <linux/module.h> |
866 |
+ #include <video/mmp_disp.h> |
867 |
+ |
868 |
+ static struct mmp_overlay *path_get_overlay(struct mmp_path *path, |
869 |
+@@ -249,3 +250,7 @@ void mmp_unregister_path(struct mmp_path *path) |
870 |
+ mutex_unlock(&disp_lock); |
871 |
+ } |
872 |
+ EXPORT_SYMBOL_GPL(mmp_unregister_path); |
873 |
++ |
874 |
++MODULE_AUTHOR("Zhou Zhu <zzhu3@×××××××.com>"); |
875 |
++MODULE_DESCRIPTION("Marvell MMP display framework"); |
876 |
++MODULE_LICENSE("GPL"); |
877 |
+diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h |
878 |
+index d72b2e7dd500..59c77c1388ae 100644 |
879 |
+--- a/include/linux/ptr_ring.h |
880 |
++++ b/include/linux/ptr_ring.h |
881 |
+@@ -451,9 +451,14 @@ static inline int ptr_ring_consume_batched_bh(struct ptr_ring *r, |
882 |
+ __PTR_RING_PEEK_CALL_v; \ |
883 |
+ }) |
884 |
+ |
885 |
++/* Not all gfp_t flags (besides GFP_KERNEL) are allowed. See |
886 |
++ * documentation for vmalloc for which of them are legal. |
887 |
++ */ |
888 |
+ static inline void **__ptr_ring_init_queue_alloc(unsigned int size, gfp_t gfp) |
889 |
+ { |
890 |
+- return kcalloc(size, sizeof(void *), gfp); |
891 |
++ if (size * sizeof(void *) > KMALLOC_MAX_SIZE) |
892 |
++ return NULL; |
893 |
++ return kvmalloc_array(size, sizeof(void *), gfp | __GFP_ZERO); |
894 |
+ } |
895 |
+ |
896 |
+ static inline void __ptr_ring_set_size(struct ptr_ring *r, int size) |
897 |
+@@ -586,7 +591,7 @@ static inline int ptr_ring_resize(struct ptr_ring *r, int size, gfp_t gfp, |
898 |
+ spin_unlock(&(r)->producer_lock); |
899 |
+ spin_unlock_irqrestore(&(r)->consumer_lock, flags); |
900 |
+ |
901 |
+- kfree(old); |
902 |
++ kvfree(old); |
903 |
+ |
904 |
+ return 0; |
905 |
+ } |
906 |
+@@ -626,7 +631,7 @@ static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, |
907 |
+ } |
908 |
+ |
909 |
+ for (i = 0; i < nrings; ++i) |
910 |
+- kfree(queues[i]); |
911 |
++ kvfree(queues[i]); |
912 |
+ |
913 |
+ kfree(queues); |
914 |
+ |
915 |
+@@ -634,7 +639,7 @@ static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, |
916 |
+ |
917 |
+ nomem: |
918 |
+ while (--i >= 0) |
919 |
+- kfree(queues[i]); |
920 |
++ kvfree(queues[i]); |
921 |
+ |
922 |
+ kfree(queues); |
923 |
+ |
924 |
+@@ -649,7 +654,7 @@ static inline void ptr_ring_cleanup(struct ptr_ring *r, void (*destroy)(void *)) |
925 |
+ if (destroy) |
926 |
+ while ((ptr = ptr_ring_consume(r))) |
927 |
+ destroy(ptr); |
928 |
+- kfree(r->queue); |
929 |
++ kvfree(r->queue); |
930 |
+ } |
931 |
+ |
932 |
+ #endif /* _LINUX_PTR_RING_H */ |
933 |
+diff --git a/kernel/kcov.c b/kernel/kcov.c |
934 |
+index 7594c033d98a..2c16f1ab5e10 100644 |
935 |
+--- a/kernel/kcov.c |
936 |
++++ b/kernel/kcov.c |
937 |
+@@ -358,7 +358,8 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, |
938 |
+ */ |
939 |
+ if (kcov->mode != KCOV_MODE_INIT || !kcov->area) |
940 |
+ return -EINVAL; |
941 |
+- if (kcov->t != NULL) |
942 |
++ t = current; |
943 |
++ if (kcov->t != NULL || t->kcov != NULL) |
944 |
+ return -EBUSY; |
945 |
+ if (arg == KCOV_TRACE_PC) |
946 |
+ kcov->mode = KCOV_MODE_TRACE_PC; |
947 |
+@@ -370,7 +371,6 @@ static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, |
948 |
+ #endif |
949 |
+ else |
950 |
+ return -EINVAL; |
951 |
+- t = current; |
952 |
+ /* Cache in task struct for performance. */ |
953 |
+ t->kcov_size = kcov->size; |
954 |
+ t->kcov_area = kcov->area; |
955 |
+diff --git a/mm/vmalloc.c b/mm/vmalloc.c |
956 |
+index 673942094328..ebff729cc956 100644 |
957 |
+--- a/mm/vmalloc.c |
958 |
++++ b/mm/vmalloc.c |
959 |
+@@ -1943,11 +1943,15 @@ void *vmalloc_exec(unsigned long size) |
960 |
+ } |
961 |
+ |
962 |
+ #if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32) |
963 |
+-#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL |
964 |
++#define GFP_VMALLOC32 (GFP_DMA32 | GFP_KERNEL) |
965 |
+ #elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA) |
966 |
+-#define GFP_VMALLOC32 GFP_DMA | GFP_KERNEL |
967 |
++#define GFP_VMALLOC32 (GFP_DMA | GFP_KERNEL) |
968 |
+ #else |
969 |
+-#define GFP_VMALLOC32 GFP_KERNEL |
970 |
++/* |
971 |
++ * 64b systems should always have either DMA or DMA32 zones. For others |
972 |
++ * GFP_DMA32 should do the right thing and use the normal zone. |
973 |
++ */ |
974 |
++#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL |
975 |
+ #endif |
976 |
+ |
977 |
+ /** |
978 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
979 |
+index 613fb4066be7..c8c102a3467f 100644 |
980 |
+--- a/net/core/dev.c |
981 |
++++ b/net/core/dev.c |
982 |
+@@ -2815,7 +2815,7 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb, |
983 |
+ |
984 |
+ segs = skb_mac_gso_segment(skb, features); |
985 |
+ |
986 |
+- if (unlikely(skb_needs_check(skb, tx_path))) |
987 |
++ if (unlikely(skb_needs_check(skb, tx_path) && !IS_ERR(segs))) |
988 |
+ skb_warn_bad_offload(skb); |
989 |
+ |
990 |
+ return segs; |
991 |
+diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c |
992 |
+index 9834cfa21b21..0a3f88f08727 100644 |
993 |
+--- a/net/core/gen_estimator.c |
994 |
++++ b/net/core/gen_estimator.c |
995 |
+@@ -159,7 +159,11 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, |
996 |
+ est->intvl_log = intvl_log; |
997 |
+ est->cpu_bstats = cpu_bstats; |
998 |
+ |
999 |
++ if (stats_lock) |
1000 |
++ local_bh_disable(); |
1001 |
+ est_fetch_counters(est, &b); |
1002 |
++ if (stats_lock) |
1003 |
++ local_bh_enable(); |
1004 |
+ est->last_bytes = b.bytes; |
1005 |
+ est->last_packets = b.packets; |
1006 |
+ old = rcu_dereference_protected(*rate_est, 1); |
1007 |
+diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c |
1008 |
+index 518cea17b811..ea9b55309483 100644 |
1009 |
+--- a/net/decnet/af_decnet.c |
1010 |
++++ b/net/decnet/af_decnet.c |
1011 |
+@@ -1338,6 +1338,12 @@ static int dn_setsockopt(struct socket *sock, int level, int optname, char __use |
1012 |
+ lock_sock(sk); |
1013 |
+ err = __dn_setsockopt(sock, level, optname, optval, optlen, 0); |
1014 |
+ release_sock(sk); |
1015 |
++#ifdef CONFIG_NETFILTER |
1016 |
++ /* we need to exclude all possible ENOPROTOOPTs except default case */ |
1017 |
++ if (err == -ENOPROTOOPT && optname != DSO_LINKINFO && |
1018 |
++ optname != DSO_STREAM && optname != DSO_SEQPACKET) |
1019 |
++ err = nf_setsockopt(sk, PF_DECnet, optname, optval, optlen); |
1020 |
++#endif |
1021 |
+ |
1022 |
+ return err; |
1023 |
+ } |
1024 |
+@@ -1445,15 +1451,6 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us |
1025 |
+ dn_nsp_send_disc(sk, 0x38, 0, sk->sk_allocation); |
1026 |
+ break; |
1027 |
+ |
1028 |
+- default: |
1029 |
+-#ifdef CONFIG_NETFILTER |
1030 |
+- return nf_setsockopt(sk, PF_DECnet, optname, optval, optlen); |
1031 |
+-#endif |
1032 |
+- case DSO_LINKINFO: |
1033 |
+- case DSO_STREAM: |
1034 |
+- case DSO_SEQPACKET: |
1035 |
+- return -ENOPROTOOPT; |
1036 |
+- |
1037 |
+ case DSO_MAXWINDOW: |
1038 |
+ if (optlen != sizeof(unsigned long)) |
1039 |
+ return -EINVAL; |
1040 |
+@@ -1501,6 +1498,12 @@ static int __dn_setsockopt(struct socket *sock, int level,int optname, char __us |
1041 |
+ return -EINVAL; |
1042 |
+ scp->info_loc = u.info; |
1043 |
+ break; |
1044 |
++ |
1045 |
++ case DSO_LINKINFO: |
1046 |
++ case DSO_STREAM: |
1047 |
++ case DSO_SEQPACKET: |
1048 |
++ default: |
1049 |
++ return -ENOPROTOOPT; |
1050 |
+ } |
1051 |
+ |
1052 |
+ return 0; |
1053 |
+@@ -1514,6 +1517,20 @@ static int dn_getsockopt(struct socket *sock, int level, int optname, char __use |
1054 |
+ lock_sock(sk); |
1055 |
+ err = __dn_getsockopt(sock, level, optname, optval, optlen, 0); |
1056 |
+ release_sock(sk); |
1057 |
++#ifdef CONFIG_NETFILTER |
1058 |
++ if (err == -ENOPROTOOPT && optname != DSO_STREAM && |
1059 |
++ optname != DSO_SEQPACKET && optname != DSO_CONACCEPT && |
1060 |
++ optname != DSO_CONREJECT) { |
1061 |
++ int len; |
1062 |
++ |
1063 |
++ if (get_user(len, optlen)) |
1064 |
++ return -EFAULT; |
1065 |
++ |
1066 |
++ err = nf_getsockopt(sk, PF_DECnet, optname, optval, &len); |
1067 |
++ if (err >= 0) |
1068 |
++ err = put_user(len, optlen); |
1069 |
++ } |
1070 |
++#endif |
1071 |
+ |
1072 |
+ return err; |
1073 |
+ } |
1074 |
+@@ -1579,26 +1596,6 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us |
1075 |
+ r_data = &link; |
1076 |
+ break; |
1077 |
+ |
1078 |
+- default: |
1079 |
+-#ifdef CONFIG_NETFILTER |
1080 |
+- { |
1081 |
+- int ret, len; |
1082 |
+- |
1083 |
+- if (get_user(len, optlen)) |
1084 |
+- return -EFAULT; |
1085 |
+- |
1086 |
+- ret = nf_getsockopt(sk, PF_DECnet, optname, optval, &len); |
1087 |
+- if (ret >= 0) |
1088 |
+- ret = put_user(len, optlen); |
1089 |
+- return ret; |
1090 |
+- } |
1091 |
+-#endif |
1092 |
+- case DSO_STREAM: |
1093 |
+- case DSO_SEQPACKET: |
1094 |
+- case DSO_CONACCEPT: |
1095 |
+- case DSO_CONREJECT: |
1096 |
+- return -ENOPROTOOPT; |
1097 |
+- |
1098 |
+ case DSO_MAXWINDOW: |
1099 |
+ if (r_len > sizeof(unsigned long)) |
1100 |
+ r_len = sizeof(unsigned long); |
1101 |
+@@ -1630,6 +1627,13 @@ static int __dn_getsockopt(struct socket *sock, int level,int optname, char __us |
1102 |
+ r_len = sizeof(unsigned char); |
1103 |
+ r_data = &scp->info_rem; |
1104 |
+ break; |
1105 |
++ |
1106 |
++ case DSO_STREAM: |
1107 |
++ case DSO_SEQPACKET: |
1108 |
++ case DSO_CONACCEPT: |
1109 |
++ case DSO_CONREJECT: |
1110 |
++ default: |
1111 |
++ return -ENOPROTOOPT; |
1112 |
+ } |
1113 |
+ |
1114 |
+ if (r_data) { |
1115 |
+diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c |
1116 |
+index 60fb1eb7d7d8..c7df4969f80a 100644 |
1117 |
+--- a/net/ipv4/ip_sockglue.c |
1118 |
++++ b/net/ipv4/ip_sockglue.c |
1119 |
+@@ -1251,11 +1251,8 @@ int ip_setsockopt(struct sock *sk, int level, |
1120 |
+ if (err == -ENOPROTOOPT && optname != IP_HDRINCL && |
1121 |
+ optname != IP_IPSEC_POLICY && |
1122 |
+ optname != IP_XFRM_POLICY && |
1123 |
+- !ip_mroute_opt(optname)) { |
1124 |
+- lock_sock(sk); |
1125 |
++ !ip_mroute_opt(optname)) |
1126 |
+ err = nf_setsockopt(sk, PF_INET, optname, optval, optlen); |
1127 |
+- release_sock(sk); |
1128 |
+- } |
1129 |
+ #endif |
1130 |
+ return err; |
1131 |
+ } |
1132 |
+@@ -1280,12 +1277,9 @@ int compat_ip_setsockopt(struct sock *sk, int level, int optname, |
1133 |
+ if (err == -ENOPROTOOPT && optname != IP_HDRINCL && |
1134 |
+ optname != IP_IPSEC_POLICY && |
1135 |
+ optname != IP_XFRM_POLICY && |
1136 |
+- !ip_mroute_opt(optname)) { |
1137 |
+- lock_sock(sk); |
1138 |
+- err = compat_nf_setsockopt(sk, PF_INET, optname, |
1139 |
+- optval, optlen); |
1140 |
+- release_sock(sk); |
1141 |
+- } |
1142 |
++ !ip_mroute_opt(optname)) |
1143 |
++ err = compat_nf_setsockopt(sk, PF_INET, optname, optval, |
1144 |
++ optlen); |
1145 |
+ #endif |
1146 |
+ return err; |
1147 |
+ } |
1148 |
+diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c |
1149 |
+index 69060e3abe85..1e4a7209a3d2 100644 |
1150 |
+--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c |
1151 |
++++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c |
1152 |
+@@ -431,7 +431,7 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par) |
1153 |
+ struct ipt_clusterip_tgt_info *cipinfo = par->targinfo; |
1154 |
+ const struct ipt_entry *e = par->entryinfo; |
1155 |
+ struct clusterip_config *config; |
1156 |
+- int ret; |
1157 |
++ int ret, i; |
1158 |
+ |
1159 |
+ if (par->nft_compat) { |
1160 |
+ pr_err("cannot use CLUSTERIP target from nftables compat\n"); |
1161 |
+@@ -450,8 +450,18 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par) |
1162 |
+ pr_info("Please specify destination IP\n"); |
1163 |
+ return -EINVAL; |
1164 |
+ } |
1165 |
+- |
1166 |
+- /* FIXME: further sanity checks */ |
1167 |
++ if (cipinfo->num_local_nodes > ARRAY_SIZE(cipinfo->local_nodes)) { |
1168 |
++ pr_info("bad num_local_nodes %u\n", cipinfo->num_local_nodes); |
1169 |
++ return -EINVAL; |
1170 |
++ } |
1171 |
++ for (i = 0; i < cipinfo->num_local_nodes; i++) { |
1172 |
++ if (cipinfo->local_nodes[i] - 1 >= |
1173 |
++ sizeof(config->local_nodes) * 8) { |
1174 |
++ pr_info("bad local_nodes[%d] %u\n", |
1175 |
++ i, cipinfo->local_nodes[i]); |
1176 |
++ return -EINVAL; |
1177 |
++ } |
1178 |
++ } |
1179 |
+ |
1180 |
+ config = clusterip_config_find_get(par->net, e->ip.dst.s_addr, 1); |
1181 |
+ if (!config) { |
1182 |
+diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |
1183 |
+index 89af9d88ca21..a5727036a8a8 100644 |
1184 |
+--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |
1185 |
++++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c |
1186 |
+@@ -218,15 +218,19 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len) |
1187 |
+ struct nf_conntrack_tuple tuple; |
1188 |
+ |
1189 |
+ memset(&tuple, 0, sizeof(tuple)); |
1190 |
++ |
1191 |
++ lock_sock(sk); |
1192 |
+ tuple.src.u3.ip = inet->inet_rcv_saddr; |
1193 |
+ tuple.src.u.tcp.port = inet->inet_sport; |
1194 |
+ tuple.dst.u3.ip = inet->inet_daddr; |
1195 |
+ tuple.dst.u.tcp.port = inet->inet_dport; |
1196 |
+ tuple.src.l3num = PF_INET; |
1197 |
+ tuple.dst.protonum = sk->sk_protocol; |
1198 |
++ release_sock(sk); |
1199 |
+ |
1200 |
+ /* We only do TCP and SCTP at the moment: is there a better way? */ |
1201 |
+- if (sk->sk_protocol != IPPROTO_TCP && sk->sk_protocol != IPPROTO_SCTP) { |
1202 |
++ if (tuple.dst.protonum != IPPROTO_TCP && |
1203 |
++ tuple.dst.protonum != IPPROTO_SCTP) { |
1204 |
+ pr_debug("SO_ORIGINAL_DST: Not a TCP/SCTP socket\n"); |
1205 |
+ return -ENOPROTOOPT; |
1206 |
+ } |
1207 |
+diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c |
1208 |
+index e8ffb5b5d84e..d78d41fc4b1a 100644 |
1209 |
+--- a/net/ipv6/ipv6_sockglue.c |
1210 |
++++ b/net/ipv6/ipv6_sockglue.c |
1211 |
+@@ -923,12 +923,8 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, |
1212 |
+ #ifdef CONFIG_NETFILTER |
1213 |
+ /* we need to exclude all possible ENOPROTOOPTs except default case */ |
1214 |
+ if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY && |
1215 |
+- optname != IPV6_XFRM_POLICY) { |
1216 |
+- lock_sock(sk); |
1217 |
+- err = nf_setsockopt(sk, PF_INET6, optname, optval, |
1218 |
+- optlen); |
1219 |
+- release_sock(sk); |
1220 |
+- } |
1221 |
++ optname != IPV6_XFRM_POLICY) |
1222 |
++ err = nf_setsockopt(sk, PF_INET6, optname, optval, optlen); |
1223 |
+ #endif |
1224 |
+ return err; |
1225 |
+ } |
1226 |
+@@ -958,12 +954,9 @@ int compat_ipv6_setsockopt(struct sock *sk, int level, int optname, |
1227 |
+ #ifdef CONFIG_NETFILTER |
1228 |
+ /* we need to exclude all possible ENOPROTOOPTs except default case */ |
1229 |
+ if (err == -ENOPROTOOPT && optname != IPV6_IPSEC_POLICY && |
1230 |
+- optname != IPV6_XFRM_POLICY) { |
1231 |
+- lock_sock(sk); |
1232 |
+- err = compat_nf_setsockopt(sk, PF_INET6, optname, |
1233 |
+- optval, optlen); |
1234 |
+- release_sock(sk); |
1235 |
+- } |
1236 |
++ optname != IPV6_XFRM_POLICY) |
1237 |
++ err = compat_nf_setsockopt(sk, PF_INET6, optname, optval, |
1238 |
++ optlen); |
1239 |
+ #endif |
1240 |
+ return err; |
1241 |
+ } |
1242 |
+diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c |
1243 |
+index 3b80a38f62b8..5863579800c1 100644 |
1244 |
+--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c |
1245 |
++++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c |
1246 |
+@@ -226,20 +226,27 @@ static const struct nf_hook_ops ipv6_conntrack_ops[] = { |
1247 |
+ static int |
1248 |
+ ipv6_getorigdst(struct sock *sk, int optval, void __user *user, int *len) |
1249 |
+ { |
1250 |
+- const struct inet_sock *inet = inet_sk(sk); |
1251 |
++ struct nf_conntrack_tuple tuple = { .src.l3num = NFPROTO_IPV6 }; |
1252 |
+ const struct ipv6_pinfo *inet6 = inet6_sk(sk); |
1253 |
++ const struct inet_sock *inet = inet_sk(sk); |
1254 |
+ const struct nf_conntrack_tuple_hash *h; |
1255 |
+ struct sockaddr_in6 sin6; |
1256 |
+- struct nf_conntrack_tuple tuple = { .src.l3num = NFPROTO_IPV6 }; |
1257 |
+ struct nf_conn *ct; |
1258 |
++ __be32 flow_label; |
1259 |
++ int bound_dev_if; |
1260 |
+ |
1261 |
++ lock_sock(sk); |
1262 |
+ tuple.src.u3.in6 = sk->sk_v6_rcv_saddr; |
1263 |
+ tuple.src.u.tcp.port = inet->inet_sport; |
1264 |
+ tuple.dst.u3.in6 = sk->sk_v6_daddr; |
1265 |
+ tuple.dst.u.tcp.port = inet->inet_dport; |
1266 |
+ tuple.dst.protonum = sk->sk_protocol; |
1267 |
++ bound_dev_if = sk->sk_bound_dev_if; |
1268 |
++ flow_label = inet6->flow_label; |
1269 |
++ release_sock(sk); |
1270 |
+ |
1271 |
+- if (sk->sk_protocol != IPPROTO_TCP && sk->sk_protocol != IPPROTO_SCTP) |
1272 |
++ if (tuple.dst.protonum != IPPROTO_TCP && |
1273 |
++ tuple.dst.protonum != IPPROTO_SCTP) |
1274 |
+ return -ENOPROTOOPT; |
1275 |
+ |
1276 |
+ if (*len < 0 || (unsigned int) *len < sizeof(sin6)) |
1277 |
+@@ -257,14 +264,13 @@ ipv6_getorigdst(struct sock *sk, int optval, void __user *user, int *len) |
1278 |
+ |
1279 |
+ sin6.sin6_family = AF_INET6; |
1280 |
+ sin6.sin6_port = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u.tcp.port; |
1281 |
+- sin6.sin6_flowinfo = inet6->flow_label & IPV6_FLOWINFO_MASK; |
1282 |
++ sin6.sin6_flowinfo = flow_label & IPV6_FLOWINFO_MASK; |
1283 |
+ memcpy(&sin6.sin6_addr, |
1284 |
+ &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.in6, |
1285 |
+ sizeof(sin6.sin6_addr)); |
1286 |
+ |
1287 |
+ nf_ct_put(ct); |
1288 |
+- sin6.sin6_scope_id = ipv6_iface_scope_id(&sin6.sin6_addr, |
1289 |
+- sk->sk_bound_dev_if); |
1290 |
++ sin6.sin6_scope_id = ipv6_iface_scope_id(&sin6.sin6_addr, bound_dev_if); |
1291 |
+ return copy_to_user(user, &sin6, sizeof(sin6)) ? -EFAULT : 0; |
1292 |
+ } |
1293 |
+ |
1294 |
+diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c |
1295 |
+index 55802e97f906..d7070d18db20 100644 |
1296 |
+--- a/net/netfilter/x_tables.c |
1297 |
++++ b/net/netfilter/x_tables.c |
1298 |
+@@ -39,7 +39,6 @@ MODULE_LICENSE("GPL"); |
1299 |
+ MODULE_AUTHOR("Harald Welte <laforge@×××××××××.org>"); |
1300 |
+ MODULE_DESCRIPTION("{ip,ip6,arp,eb}_tables backend module"); |
1301 |
+ |
1302 |
+-#define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1)) |
1303 |
+ #define XT_PCPU_BLOCK_SIZE 4096 |
1304 |
+ |
1305 |
+ struct compat_delta { |
1306 |
+@@ -210,6 +209,9 @@ xt_request_find_match(uint8_t nfproto, const char *name, uint8_t revision) |
1307 |
+ { |
1308 |
+ struct xt_match *match; |
1309 |
+ |
1310 |
++ if (strnlen(name, XT_EXTENSION_MAXNAMELEN) == XT_EXTENSION_MAXNAMELEN) |
1311 |
++ return ERR_PTR(-EINVAL); |
1312 |
++ |
1313 |
+ match = xt_find_match(nfproto, name, revision); |
1314 |
+ if (IS_ERR(match)) { |
1315 |
+ request_module("%st_%s", xt_prefix[nfproto], name); |
1316 |
+@@ -252,6 +254,9 @@ struct xt_target *xt_request_find_target(u8 af, const char *name, u8 revision) |
1317 |
+ { |
1318 |
+ struct xt_target *target; |
1319 |
+ |
1320 |
++ if (strnlen(name, XT_EXTENSION_MAXNAMELEN) == XT_EXTENSION_MAXNAMELEN) |
1321 |
++ return ERR_PTR(-EINVAL); |
1322 |
++ |
1323 |
+ target = xt_find_target(af, name, revision); |
1324 |
+ if (IS_ERR(target)) { |
1325 |
+ request_module("%st_%s", xt_prefix[af], name); |
1326 |
+@@ -1000,7 +1005,7 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size) |
1327 |
+ return NULL; |
1328 |
+ |
1329 |
+ /* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */ |
1330 |
+- if ((SMP_ALIGN(size) >> PAGE_SHIFT) + 2 > totalram_pages) |
1331 |
++ if ((size >> PAGE_SHIFT) + 2 > totalram_pages) |
1332 |
+ return NULL; |
1333 |
+ |
1334 |
+ info = kvmalloc(sz, GFP_KERNEL); |
1335 |
+diff --git a/net/netfilter/xt_RATEEST.c b/net/netfilter/xt_RATEEST.c |
1336 |
+index 498b54fd04d7..141c295191f6 100644 |
1337 |
+--- a/net/netfilter/xt_RATEEST.c |
1338 |
++++ b/net/netfilter/xt_RATEEST.c |
1339 |
+@@ -39,23 +39,31 @@ static void xt_rateest_hash_insert(struct xt_rateest *est) |
1340 |
+ hlist_add_head(&est->list, &rateest_hash[h]); |
1341 |
+ } |
1342 |
+ |
1343 |
+-struct xt_rateest *xt_rateest_lookup(const char *name) |
1344 |
++static struct xt_rateest *__xt_rateest_lookup(const char *name) |
1345 |
+ { |
1346 |
+ struct xt_rateest *est; |
1347 |
+ unsigned int h; |
1348 |
+ |
1349 |
+ h = xt_rateest_hash(name); |
1350 |
+- mutex_lock(&xt_rateest_mutex); |
1351 |
+ hlist_for_each_entry(est, &rateest_hash[h], list) { |
1352 |
+ if (strcmp(est->name, name) == 0) { |
1353 |
+ est->refcnt++; |
1354 |
+- mutex_unlock(&xt_rateest_mutex); |
1355 |
+ return est; |
1356 |
+ } |
1357 |
+ } |
1358 |
+- mutex_unlock(&xt_rateest_mutex); |
1359 |
++ |
1360 |
+ return NULL; |
1361 |
+ } |
1362 |
++ |
1363 |
++struct xt_rateest *xt_rateest_lookup(const char *name) |
1364 |
++{ |
1365 |
++ struct xt_rateest *est; |
1366 |
++ |
1367 |
++ mutex_lock(&xt_rateest_mutex); |
1368 |
++ est = __xt_rateest_lookup(name); |
1369 |
++ mutex_unlock(&xt_rateest_mutex); |
1370 |
++ return est; |
1371 |
++} |
1372 |
+ EXPORT_SYMBOL_GPL(xt_rateest_lookup); |
1373 |
+ |
1374 |
+ void xt_rateest_put(struct xt_rateest *est) |
1375 |
+@@ -100,8 +108,10 @@ static int xt_rateest_tg_checkentry(const struct xt_tgchk_param *par) |
1376 |
+ |
1377 |
+ net_get_random_once(&jhash_rnd, sizeof(jhash_rnd)); |
1378 |
+ |
1379 |
+- est = xt_rateest_lookup(info->name); |
1380 |
++ mutex_lock(&xt_rateest_mutex); |
1381 |
++ est = __xt_rateest_lookup(info->name); |
1382 |
+ if (est) { |
1383 |
++ mutex_unlock(&xt_rateest_mutex); |
1384 |
+ /* |
1385 |
+ * If estimator parameters are specified, they must match the |
1386 |
+ * existing estimator. |
1387 |
+@@ -139,11 +149,13 @@ static int xt_rateest_tg_checkentry(const struct xt_tgchk_param *par) |
1388 |
+ |
1389 |
+ info->est = est; |
1390 |
+ xt_rateest_hash_insert(est); |
1391 |
++ mutex_unlock(&xt_rateest_mutex); |
1392 |
+ return 0; |
1393 |
+ |
1394 |
+ err2: |
1395 |
+ kfree(est); |
1396 |
+ err1: |
1397 |
++ mutex_unlock(&xt_rateest_mutex); |
1398 |
+ return ret; |
1399 |
+ } |
1400 |
+ |
1401 |
+diff --git a/net/netfilter/xt_cgroup.c b/net/netfilter/xt_cgroup.c |
1402 |
+index 1db1ce59079f..891f4e7e8ea7 100644 |
1403 |
+--- a/net/netfilter/xt_cgroup.c |
1404 |
++++ b/net/netfilter/xt_cgroup.c |
1405 |
+@@ -52,6 +52,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par) |
1406 |
+ return -EINVAL; |
1407 |
+ } |
1408 |
+ |
1409 |
++ info->priv = NULL; |
1410 |
+ if (info->has_path) { |
1411 |
+ cgrp = cgroup_get_from_path(info->path); |
1412 |
+ if (IS_ERR(cgrp)) { |
1413 |
+diff --git a/net/rds/connection.c b/net/rds/connection.c |
1414 |
+index 7ee2d5d68b78..9efc82c665b5 100644 |
1415 |
+--- a/net/rds/connection.c |
1416 |
++++ b/net/rds/connection.c |
1417 |
+@@ -366,6 +366,8 @@ void rds_conn_shutdown(struct rds_conn_path *cp) |
1418 |
+ * to the conn hash, so we never trigger a reconnect on this |
1419 |
+ * conn - the reconnect is always triggered by the active peer. */ |
1420 |
+ cancel_delayed_work_sync(&cp->cp_conn_w); |
1421 |
++ if (conn->c_destroy_in_prog) |
1422 |
++ return; |
1423 |
+ rcu_read_lock(); |
1424 |
+ if (!hlist_unhashed(&conn->c_hash_node)) { |
1425 |
+ rcu_read_unlock(); |
1426 |
+@@ -445,7 +447,6 @@ void rds_conn_destroy(struct rds_connection *conn) |
1427 |
+ */ |
1428 |
+ rds_cong_remove_conn(conn); |
1429 |
+ |
1430 |
+- put_net(conn->c_net); |
1431 |
+ kfree(conn->c_path); |
1432 |
+ kmem_cache_free(rds_conn_slab, conn); |
1433 |
+ |
1434 |
+diff --git a/net/rds/rds.h b/net/rds/rds.h |
1435 |
+index c349c71babff..d09f6c1facb4 100644 |
1436 |
+--- a/net/rds/rds.h |
1437 |
++++ b/net/rds/rds.h |
1438 |
+@@ -150,7 +150,7 @@ struct rds_connection { |
1439 |
+ |
1440 |
+ /* Protocol version */ |
1441 |
+ unsigned int c_version; |
1442 |
+- struct net *c_net; |
1443 |
++ possible_net_t c_net; |
1444 |
+ |
1445 |
+ struct list_head c_map_item; |
1446 |
+ unsigned long c_map_queued; |
1447 |
+@@ -165,13 +165,13 @@ struct rds_connection { |
1448 |
+ static inline |
1449 |
+ struct net *rds_conn_net(struct rds_connection *conn) |
1450 |
+ { |
1451 |
+- return conn->c_net; |
1452 |
++ return read_pnet(&conn->c_net); |
1453 |
+ } |
1454 |
+ |
1455 |
+ static inline |
1456 |
+ void rds_conn_net_set(struct rds_connection *conn, struct net *net) |
1457 |
+ { |
1458 |
+- conn->c_net = get_net(net); |
1459 |
++ write_pnet(&conn->c_net, net); |
1460 |
+ } |
1461 |
+ |
1462 |
+ #define RDS_FLAG_CONG_BITMAP 0x01 |
1463 |
+diff --git a/net/rds/tcp.c b/net/rds/tcp.c |
1464 |
+index ab7356e0ba83..4df21e47d2ab 100644 |
1465 |
+--- a/net/rds/tcp.c |
1466 |
++++ b/net/rds/tcp.c |
1467 |
+@@ -307,7 +307,8 @@ static void rds_tcp_conn_free(void *arg) |
1468 |
+ rdsdebug("freeing tc %p\n", tc); |
1469 |
+ |
1470 |
+ spin_lock_irqsave(&rds_tcp_conn_lock, flags); |
1471 |
+- list_del(&tc->t_tcp_node); |
1472 |
++ if (!tc->t_tcp_node_detached) |
1473 |
++ list_del(&tc->t_tcp_node); |
1474 |
+ spin_unlock_irqrestore(&rds_tcp_conn_lock, flags); |
1475 |
+ |
1476 |
+ kmem_cache_free(rds_tcp_conn_slab, tc); |
1477 |
+@@ -528,12 +529,16 @@ static void rds_tcp_kill_sock(struct net *net) |
1478 |
+ rds_tcp_listen_stop(lsock, &rtn->rds_tcp_accept_w); |
1479 |
+ spin_lock_irq(&rds_tcp_conn_lock); |
1480 |
+ list_for_each_entry_safe(tc, _tc, &rds_tcp_conn_list, t_tcp_node) { |
1481 |
+- struct net *c_net = tc->t_cpath->cp_conn->c_net; |
1482 |
++ struct net *c_net = read_pnet(&tc->t_cpath->cp_conn->c_net); |
1483 |
+ |
1484 |
+ if (net != c_net || !tc->t_sock) |
1485 |
+ continue; |
1486 |
+- if (!list_has_conn(&tmp_list, tc->t_cpath->cp_conn)) |
1487 |
++ if (!list_has_conn(&tmp_list, tc->t_cpath->cp_conn)) { |
1488 |
+ list_move_tail(&tc->t_tcp_node, &tmp_list); |
1489 |
++ } else { |
1490 |
++ list_del(&tc->t_tcp_node); |
1491 |
++ tc->t_tcp_node_detached = true; |
1492 |
++ } |
1493 |
+ } |
1494 |
+ spin_unlock_irq(&rds_tcp_conn_lock); |
1495 |
+ list_for_each_entry_safe(tc, _tc, &tmp_list, t_tcp_node) { |
1496 |
+@@ -587,7 +592,7 @@ static void rds_tcp_sysctl_reset(struct net *net) |
1497 |
+ |
1498 |
+ spin_lock_irq(&rds_tcp_conn_lock); |
1499 |
+ list_for_each_entry_safe(tc, _tc, &rds_tcp_conn_list, t_tcp_node) { |
1500 |
+- struct net *c_net = tc->t_cpath->cp_conn->c_net; |
1501 |
++ struct net *c_net = read_pnet(&tc->t_cpath->cp_conn->c_net); |
1502 |
+ |
1503 |
+ if (net != c_net || !tc->t_sock) |
1504 |
+ continue; |
1505 |
+diff --git a/net/rds/tcp.h b/net/rds/tcp.h |
1506 |
+index 864ca7d8f019..c6fa080e9b6d 100644 |
1507 |
+--- a/net/rds/tcp.h |
1508 |
++++ b/net/rds/tcp.h |
1509 |
+@@ -12,6 +12,7 @@ struct rds_tcp_incoming { |
1510 |
+ struct rds_tcp_connection { |
1511 |
+ |
1512 |
+ struct list_head t_tcp_node; |
1513 |
++ bool t_tcp_node_detached; |
1514 |
+ struct rds_conn_path *t_cpath; |
1515 |
+ /* t_conn_path_lock synchronizes the connection establishment between |
1516 |
+ * rds_tcp_accept_one and rds_tcp_conn_path_connect |
1517 |
+diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c |
1518 |
+index 33cfe5d3d6cb..8900ea5cbabf 100644 |
1519 |
+--- a/security/selinux/ss/services.c |
1520 |
++++ b/security/selinux/ss/services.c |
1521 |
+@@ -867,6 +867,9 @@ int security_bounded_transition(u32 old_sid, u32 new_sid) |
1522 |
+ int index; |
1523 |
+ int rc; |
1524 |
+ |
1525 |
++ if (!ss_initialized) |
1526 |
++ return 0; |
1527 |
++ |
1528 |
+ read_lock(&policy_rwlock); |
1529 |
+ |
1530 |
+ rc = -EINVAL; |
1531 |
+@@ -1413,27 +1416,25 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len, |
1532 |
+ if (!scontext_len) |
1533 |
+ return -EINVAL; |
1534 |
+ |
1535 |
++ /* Copy the string to allow changes and ensure a NUL terminator */ |
1536 |
++ scontext2 = kmemdup_nul(scontext, scontext_len, gfp_flags); |
1537 |
++ if (!scontext2) |
1538 |
++ return -ENOMEM; |
1539 |
++ |
1540 |
+ if (!ss_initialized) { |
1541 |
+ int i; |
1542 |
+ |
1543 |
+ for (i = 1; i < SECINITSID_NUM; i++) { |
1544 |
+- if (!strcmp(initial_sid_to_string[i], scontext)) { |
1545 |
++ if (!strcmp(initial_sid_to_string[i], scontext2)) { |
1546 |
+ *sid = i; |
1547 |
+- return 0; |
1548 |
++ goto out; |
1549 |
+ } |
1550 |
+ } |
1551 |
+ *sid = SECINITSID_KERNEL; |
1552 |
+- return 0; |
1553 |
++ goto out; |
1554 |
+ } |
1555 |
+ *sid = SECSID_NULL; |
1556 |
+ |
1557 |
+- /* Copy the string so that we can modify the copy as we parse it. */ |
1558 |
+- scontext2 = kmalloc(scontext_len + 1, gfp_flags); |
1559 |
+- if (!scontext2) |
1560 |
+- return -ENOMEM; |
1561 |
+- memcpy(scontext2, scontext, scontext_len); |
1562 |
+- scontext2[scontext_len] = 0; |
1563 |
+- |
1564 |
+ if (force) { |
1565 |
+ /* Save another copy for storing in uninterpreted form */ |
1566 |
+ rc = -ENOMEM; |
1567 |
+diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c |
1568 |
+index 070a6880980e..c60a57797640 100644 |
1569 |
+--- a/sound/soc/ux500/mop500.c |
1570 |
++++ b/sound/soc/ux500/mop500.c |
1571 |
+@@ -163,3 +163,7 @@ static struct platform_driver snd_soc_mop500_driver = { |
1572 |
+ }; |
1573 |
+ |
1574 |
+ module_platform_driver(snd_soc_mop500_driver); |
1575 |
++ |
1576 |
++MODULE_LICENSE("GPL v2"); |
1577 |
++MODULE_DESCRIPTION("ASoC MOP500 board driver"); |
1578 |
++MODULE_AUTHOR("Ola Lilja"); |
1579 |
+diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c |
1580 |
+index f12c01dddc8d..d35ba7700f46 100644 |
1581 |
+--- a/sound/soc/ux500/ux500_pcm.c |
1582 |
++++ b/sound/soc/ux500/ux500_pcm.c |
1583 |
+@@ -165,3 +165,8 @@ int ux500_pcm_unregister_platform(struct platform_device *pdev) |
1584 |
+ return 0; |
1585 |
+ } |
1586 |
+ EXPORT_SYMBOL_GPL(ux500_pcm_unregister_platform); |
1587 |
++ |
1588 |
++MODULE_AUTHOR("Ola Lilja"); |
1589 |
++MODULE_AUTHOR("Roger Nilsson"); |
1590 |
++MODULE_DESCRIPTION("ASoC UX500 driver"); |
1591 |
++MODULE_LICENSE("GPL v2"); |