1 |
commit: 43e29807be51c90e3f3f2282d29ed8c716956841 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 19 10:03:21 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 29 13:59:02 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=43e29807 |
7 |
|
8 |
Linux patch 4.14.145 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1144_linux-4.14.145.patch | 1345 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1349 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index af1af17..38ce5d6 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -619,6 +619,10 @@ Patch: 1143_linux-4.14.144.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.14.144 |
23 |
|
24 |
+Patch: 1144_linux-4.14.145.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.14.145 |
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/1144_linux-4.14.145.patch b/1144_linux-4.14.145.patch |
33 |
new file mode 100644 |
34 |
index 0000000..33ff4ed |
35 |
--- /dev/null |
36 |
+++ b/1144_linux-4.14.145.patch |
37 |
@@ -0,0 +1,1345 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 4aa0dfec9b9b..ce521c48b35e 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 14 |
46 |
+-SUBLEVEL = 144 |
47 |
++SUBLEVEL = 145 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Petit Gorille |
50 |
+ |
51 |
+diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig |
52 |
+index 8d4470f44b74..ae4450e891ab 100644 |
53 |
+--- a/arch/mips/Kconfig |
54 |
++++ b/arch/mips/Kconfig |
55 |
+@@ -800,7 +800,6 @@ config SIBYTE_SWARM |
56 |
+ select SYS_SUPPORTS_HIGHMEM |
57 |
+ select SYS_SUPPORTS_LITTLE_ENDIAN |
58 |
+ select ZONE_DMA32 if 64BIT |
59 |
+- select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI |
60 |
+ |
61 |
+ config SIBYTE_LITTLESUR |
62 |
+ bool "Sibyte BCM91250C2-LittleSur" |
63 |
+@@ -823,7 +822,6 @@ config SIBYTE_SENTOSA |
64 |
+ select SYS_HAS_CPU_SB1 |
65 |
+ select SYS_SUPPORTS_BIG_ENDIAN |
66 |
+ select SYS_SUPPORTS_LITTLE_ENDIAN |
67 |
+- select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI |
68 |
+ |
69 |
+ config SIBYTE_BIGSUR |
70 |
+ bool "Sibyte BCM91480B-BigSur" |
71 |
+@@ -837,7 +835,6 @@ config SIBYTE_BIGSUR |
72 |
+ select SYS_SUPPORTS_HIGHMEM |
73 |
+ select SYS_SUPPORTS_LITTLE_ENDIAN |
74 |
+ select ZONE_DMA32 if 64BIT |
75 |
+- select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI |
76 |
+ |
77 |
+ config SNI_RM |
78 |
+ bool "SNI RM200/300/400" |
79 |
+diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h |
80 |
+index 9e494f8d9c03..af19d1300a4c 100644 |
81 |
+--- a/arch/mips/include/asm/smp.h |
82 |
++++ b/arch/mips/include/asm/smp.h |
83 |
+@@ -25,7 +25,17 @@ extern cpumask_t cpu_sibling_map[]; |
84 |
+ extern cpumask_t cpu_core_map[]; |
85 |
+ extern cpumask_t cpu_foreign_map[]; |
86 |
+ |
87 |
+-#define raw_smp_processor_id() (current_thread_info()->cpu) |
88 |
++static inline int raw_smp_processor_id(void) |
89 |
++{ |
90 |
++#if defined(__VDSO__) |
91 |
++ extern int vdso_smp_processor_id(void) |
92 |
++ __compiletime_error("VDSO should not call smp_processor_id()"); |
93 |
++ return vdso_smp_processor_id(); |
94 |
++#else |
95 |
++ return current_thread_info()->cpu; |
96 |
++#endif |
97 |
++} |
98 |
++#define raw_smp_processor_id raw_smp_processor_id |
99 |
+ |
100 |
+ /* Map from cpu id to sequential logical cpu number. This will only |
101 |
+ not be idempotent when cpus failed to come on-line. */ |
102 |
+diff --git a/arch/mips/sibyte/common/Makefile b/arch/mips/sibyte/common/Makefile |
103 |
+index 3ef3fb658136..b3d6bf23a662 100644 |
104 |
+--- a/arch/mips/sibyte/common/Makefile |
105 |
++++ b/arch/mips/sibyte/common/Makefile |
106 |
+@@ -1,5 +1,4 @@ |
107 |
+ obj-y := cfe.o |
108 |
+-obj-$(CONFIG_SWIOTLB) += dma.o |
109 |
+ obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o |
110 |
+ obj-$(CONFIG_SIBYTE_CFE_CONSOLE) += cfe_console.o |
111 |
+ obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o |
112 |
+diff --git a/arch/mips/sibyte/common/dma.c b/arch/mips/sibyte/common/dma.c |
113 |
+deleted file mode 100644 |
114 |
+index eb47a94f3583..000000000000 |
115 |
+--- a/arch/mips/sibyte/common/dma.c |
116 |
++++ /dev/null |
117 |
+@@ -1,14 +0,0 @@ |
118 |
+-// SPDX-License-Identifier: GPL-2.0+ |
119 |
+-/* |
120 |
+- * DMA support for Broadcom SiByte platforms. |
121 |
+- * |
122 |
+- * Copyright (c) 2018 Maciej W. Rozycki |
123 |
+- */ |
124 |
+- |
125 |
+-#include <linux/swiotlb.h> |
126 |
+-#include <asm/bootinfo.h> |
127 |
+- |
128 |
+-void __init plat_swiotlb_setup(void) |
129 |
+-{ |
130 |
+- swiotlb_init(1); |
131 |
+-} |
132 |
+diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile |
133 |
+index d1a60690e690..0f455fdf822a 100644 |
134 |
+--- a/arch/mips/vdso/Makefile |
135 |
++++ b/arch/mips/vdso/Makefile |
136 |
+@@ -7,7 +7,9 @@ ccflags-vdso := \ |
137 |
+ $(filter -I%,$(KBUILD_CFLAGS)) \ |
138 |
+ $(filter -E%,$(KBUILD_CFLAGS)) \ |
139 |
+ $(filter -mmicromips,$(KBUILD_CFLAGS)) \ |
140 |
+- $(filter -march=%,$(KBUILD_CFLAGS)) |
141 |
++ $(filter -march=%,$(KBUILD_CFLAGS)) \ |
142 |
++ $(filter -m%-float,$(KBUILD_CFLAGS)) \ |
143 |
++ -D__VDSO__ |
144 |
+ cflags-vdso := $(ccflags-vdso) \ |
145 |
+ $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \ |
146 |
+ -O2 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \ |
147 |
+diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h |
148 |
+index bd6d0fb5be9f..51f00c00d7e4 100644 |
149 |
+--- a/arch/powerpc/include/asm/uaccess.h |
150 |
++++ b/arch/powerpc/include/asm/uaccess.h |
151 |
+@@ -280,6 +280,7 @@ extern unsigned long __copy_tofrom_user(void __user *to, |
152 |
+ static inline unsigned long |
153 |
+ raw_copy_in_user(void __user *to, const void __user *from, unsigned long n) |
154 |
+ { |
155 |
++ barrier_nospec(); |
156 |
+ return __copy_tofrom_user(to, from, n); |
157 |
+ } |
158 |
+ #endif /* __powerpc64__ */ |
159 |
+diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c |
160 |
+index 5185be314661..28f3796d23c8 100644 |
161 |
+--- a/arch/s390/kvm/interrupt.c |
162 |
++++ b/arch/s390/kvm/interrupt.c |
163 |
+@@ -1701,6 +1701,16 @@ int s390int_to_s390irq(struct kvm_s390_interrupt *s390int, |
164 |
+ case KVM_S390_MCHK: |
165 |
+ irq->u.mchk.mcic = s390int->parm64; |
166 |
+ break; |
167 |
++ case KVM_S390_INT_PFAULT_INIT: |
168 |
++ irq->u.ext.ext_params = s390int->parm; |
169 |
++ irq->u.ext.ext_params2 = s390int->parm64; |
170 |
++ break; |
171 |
++ case KVM_S390_RESTART: |
172 |
++ case KVM_S390_INT_CLOCK_COMP: |
173 |
++ case KVM_S390_INT_CPU_TIMER: |
174 |
++ break; |
175 |
++ default: |
176 |
++ return -EINVAL; |
177 |
+ } |
178 |
+ return 0; |
179 |
+ } |
180 |
+diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c |
181 |
+index 70a446ec347d..a27fb640adbe 100644 |
182 |
+--- a/arch/s390/kvm/kvm-s390.c |
183 |
++++ b/arch/s390/kvm/kvm-s390.c |
184 |
+@@ -3730,7 +3730,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, |
185 |
+ } |
186 |
+ case KVM_S390_INTERRUPT: { |
187 |
+ struct kvm_s390_interrupt s390int; |
188 |
+- struct kvm_s390_irq s390irq; |
189 |
++ struct kvm_s390_irq s390irq = {}; |
190 |
+ |
191 |
+ r = -EFAULT; |
192 |
+ if (copy_from_user(&s390int, argp, sizeof(s390int))) |
193 |
+diff --git a/arch/x86/Makefile b/arch/x86/Makefile |
194 |
+index b4c72da8a7ad..cd596ca60901 100644 |
195 |
+--- a/arch/x86/Makefile |
196 |
++++ b/arch/x86/Makefile |
197 |
+@@ -39,6 +39,7 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os -D__KERNEL__ \ |
198 |
+ |
199 |
+ REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding) |
200 |
+ REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector) |
201 |
++REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -Wno-address-of-packed-member) |
202 |
+ REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4)) |
203 |
+ export REALMODE_CFLAGS |
204 |
+ |
205 |
+diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c |
206 |
+index f467d85b0352..a5a77a19adf6 100644 |
207 |
+--- a/arch/x86/kvm/vmx.c |
208 |
++++ b/arch/x86/kvm/vmx.c |
209 |
+@@ -7996,6 +7996,7 @@ static int handle_vmread(struct kvm_vcpu *vcpu) |
210 |
+ unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION); |
211 |
+ u32 vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO); |
212 |
+ gva_t gva = 0; |
213 |
++ struct x86_exception e; |
214 |
+ |
215 |
+ if (!nested_vmx_check_permission(vcpu)) |
216 |
+ return 1; |
217 |
+@@ -8023,8 +8024,10 @@ static int handle_vmread(struct kvm_vcpu *vcpu) |
218 |
+ vmx_instruction_info, true, &gva)) |
219 |
+ return 1; |
220 |
+ /* _system ok, nested_vmx_check_permission has verified cpl=0 */ |
221 |
+- kvm_write_guest_virt_system(vcpu, gva, &field_value, |
222 |
+- (is_long_mode(vcpu) ? 8 : 4), NULL); |
223 |
++ if (kvm_write_guest_virt_system(vcpu, gva, &field_value, |
224 |
++ (is_long_mode(vcpu) ? 8 : 4), |
225 |
++ NULL)) |
226 |
++ kvm_inject_page_fault(vcpu, &e); |
227 |
+ } |
228 |
+ |
229 |
+ nested_vmx_succeed(vcpu); |
230 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
231 |
+index c502f2e106db..def9c844c322 100644 |
232 |
+--- a/arch/x86/kvm/x86.c |
233 |
++++ b/arch/x86/kvm/x86.c |
234 |
+@@ -4721,6 +4721,13 @@ int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu, gva_t addr, void *val, |
235 |
+ /* kvm_write_guest_virt_system can pull in tons of pages. */ |
236 |
+ vcpu->arch.l1tf_flush_l1d = true; |
237 |
+ |
238 |
++ /* |
239 |
++ * FIXME: this should call handle_emulation_failure if X86EMUL_IO_NEEDED |
240 |
++ * is returned, but our callers are not ready for that and they blindly |
241 |
++ * call kvm_inject_page_fault. Ensure that they at least do not leak |
242 |
++ * uninitialized kernel stack memory into cr2 and error code. |
243 |
++ */ |
244 |
++ memset(exception, 0, sizeof(*exception)); |
245 |
+ return kvm_write_guest_virt_helper(addr, val, bytes, vcpu, |
246 |
+ PFERR_WRITE_MASK, exception); |
247 |
+ } |
248 |
+diff --git a/drivers/base/core.c b/drivers/base/core.c |
249 |
+index 1c67bf24bc23..2ec9af90cd28 100644 |
250 |
+--- a/drivers/base/core.c |
251 |
++++ b/drivers/base/core.c |
252 |
+@@ -1572,12 +1572,63 @@ static inline struct kobject *get_glue_dir(struct device *dev) |
253 |
+ */ |
254 |
+ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir) |
255 |
+ { |
256 |
++ unsigned int ref; |
257 |
++ |
258 |
+ /* see if we live in a "glue" directory */ |
259 |
+ if (!live_in_glue_dir(glue_dir, dev)) |
260 |
+ return; |
261 |
+ |
262 |
+ mutex_lock(&gdp_mutex); |
263 |
+- if (!kobject_has_children(glue_dir)) |
264 |
++ /** |
265 |
++ * There is a race condition between removing glue directory |
266 |
++ * and adding a new device under the glue directory. |
267 |
++ * |
268 |
++ * CPU1: CPU2: |
269 |
++ * |
270 |
++ * device_add() |
271 |
++ * get_device_parent() |
272 |
++ * class_dir_create_and_add() |
273 |
++ * kobject_add_internal() |
274 |
++ * create_dir() // create glue_dir |
275 |
++ * |
276 |
++ * device_add() |
277 |
++ * get_device_parent() |
278 |
++ * kobject_get() // get glue_dir |
279 |
++ * |
280 |
++ * device_del() |
281 |
++ * cleanup_glue_dir() |
282 |
++ * kobject_del(glue_dir) |
283 |
++ * |
284 |
++ * kobject_add() |
285 |
++ * kobject_add_internal() |
286 |
++ * create_dir() // in glue_dir |
287 |
++ * sysfs_create_dir_ns() |
288 |
++ * kernfs_create_dir_ns(sd) |
289 |
++ * |
290 |
++ * sysfs_remove_dir() // glue_dir->sd=NULL |
291 |
++ * sysfs_put() // free glue_dir->sd |
292 |
++ * |
293 |
++ * // sd is freed |
294 |
++ * kernfs_new_node(sd) |
295 |
++ * kernfs_get(glue_dir) |
296 |
++ * kernfs_add_one() |
297 |
++ * kernfs_put() |
298 |
++ * |
299 |
++ * Before CPU1 remove last child device under glue dir, if CPU2 add |
300 |
++ * a new device under glue dir, the glue_dir kobject reference count |
301 |
++ * will be increase to 2 in kobject_get(k). And CPU2 has been called |
302 |
++ * kernfs_create_dir_ns(). Meanwhile, CPU1 call sysfs_remove_dir() |
303 |
++ * and sysfs_put(). This result in glue_dir->sd is freed. |
304 |
++ * |
305 |
++ * Then the CPU2 will see a stale "empty" but still potentially used |
306 |
++ * glue dir around in kernfs_new_node(). |
307 |
++ * |
308 |
++ * In order to avoid this happening, we also should make sure that |
309 |
++ * kernfs_node for glue_dir is released in CPU1 only when refcount |
310 |
++ * for glue_dir kobj is 1. |
311 |
++ */ |
312 |
++ ref = kref_read(&glue_dir->kref); |
313 |
++ if (!kobject_has_children(glue_dir) && !--ref) |
314 |
+ kobject_del(glue_dir); |
315 |
+ kobject_put(glue_dir); |
316 |
+ mutex_unlock(&gdp_mutex); |
317 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
318 |
+index dae8723dde8c..7b5a06b27746 100644 |
319 |
+--- a/drivers/bluetooth/btusb.c |
320 |
++++ b/drivers/bluetooth/btusb.c |
321 |
+@@ -1124,10 +1124,6 @@ static int btusb_open(struct hci_dev *hdev) |
322 |
+ } |
323 |
+ |
324 |
+ data->intf->needs_remote_wakeup = 1; |
325 |
+- /* device specific wakeup source enabled and required for USB |
326 |
+- * remote wakeup while host is suspended |
327 |
+- */ |
328 |
+- device_wakeup_enable(&data->udev->dev); |
329 |
+ |
330 |
+ if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags)) |
331 |
+ goto done; |
332 |
+@@ -1191,7 +1187,6 @@ static int btusb_close(struct hci_dev *hdev) |
333 |
+ goto failed; |
334 |
+ |
335 |
+ data->intf->needs_remote_wakeup = 0; |
336 |
+- device_wakeup_disable(&data->udev->dev); |
337 |
+ usb_autopm_put_interface(data->intf); |
338 |
+ |
339 |
+ failed: |
340 |
+diff --git a/drivers/clk/rockchip/clk-mmc-phase.c b/drivers/clk/rockchip/clk-mmc-phase.c |
341 |
+index fe7d9ed1d436..b0a18bc1a27f 100644 |
342 |
+--- a/drivers/clk/rockchip/clk-mmc-phase.c |
343 |
++++ b/drivers/clk/rockchip/clk-mmc-phase.c |
344 |
+@@ -59,10 +59,8 @@ static int rockchip_mmc_get_phase(struct clk_hw *hw) |
345 |
+ u32 delay_num = 0; |
346 |
+ |
347 |
+ /* See the comment for rockchip_mmc_set_phase below */ |
348 |
+- if (!rate) { |
349 |
+- pr_err("%s: invalid clk rate\n", __func__); |
350 |
++ if (!rate) |
351 |
+ return -EINVAL; |
352 |
+- } |
353 |
+ |
354 |
+ raw_value = readl(mmc_clock->reg) >> (mmc_clock->shift); |
355 |
+ |
356 |
+diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c |
357 |
+index a0cd4f6085d0..3465a440ca02 100644 |
358 |
+--- a/drivers/crypto/talitos.c |
359 |
++++ b/drivers/crypto/talitos.c |
360 |
+@@ -943,11 +943,13 @@ static void talitos_sg_unmap(struct device *dev, |
361 |
+ |
362 |
+ static void ipsec_esp_unmap(struct device *dev, |
363 |
+ struct talitos_edesc *edesc, |
364 |
+- struct aead_request *areq) |
365 |
++ struct aead_request *areq, bool encrypt) |
366 |
+ { |
367 |
+ struct crypto_aead *aead = crypto_aead_reqtfm(areq); |
368 |
+ struct talitos_ctx *ctx = crypto_aead_ctx(aead); |
369 |
+ unsigned int ivsize = crypto_aead_ivsize(aead); |
370 |
++ unsigned int authsize = crypto_aead_authsize(aead); |
371 |
++ unsigned int cryptlen = areq->cryptlen - (encrypt ? 0 : authsize); |
372 |
+ |
373 |
+ if (edesc->desc.hdr & DESC_HDR_TYPE_IPSEC_ESP) |
374 |
+ unmap_single_talitos_ptr(dev, &edesc->desc.ptr[6], |
375 |
+@@ -956,7 +958,7 @@ static void ipsec_esp_unmap(struct device *dev, |
376 |
+ unmap_single_talitos_ptr(dev, &edesc->desc.ptr[2], DMA_TO_DEVICE); |
377 |
+ unmap_single_talitos_ptr(dev, &edesc->desc.ptr[0], DMA_TO_DEVICE); |
378 |
+ |
379 |
+- talitos_sg_unmap(dev, edesc, areq->src, areq->dst, areq->cryptlen, |
380 |
++ talitos_sg_unmap(dev, edesc, areq->src, areq->dst, cryptlen, |
381 |
+ areq->assoclen); |
382 |
+ |
383 |
+ if (edesc->dma_len) |
384 |
+@@ -967,7 +969,7 @@ static void ipsec_esp_unmap(struct device *dev, |
385 |
+ unsigned int dst_nents = edesc->dst_nents ? : 1; |
386 |
+ |
387 |
+ sg_pcopy_to_buffer(areq->dst, dst_nents, ctx->iv, ivsize, |
388 |
+- areq->assoclen + areq->cryptlen - ivsize); |
389 |
++ areq->assoclen + cryptlen - ivsize); |
390 |
+ } |
391 |
+ } |
392 |
+ |
393 |
+@@ -988,7 +990,7 @@ static void ipsec_esp_encrypt_done(struct device *dev, |
394 |
+ |
395 |
+ edesc = container_of(desc, struct talitos_edesc, desc); |
396 |
+ |
397 |
+- ipsec_esp_unmap(dev, edesc, areq); |
398 |
++ ipsec_esp_unmap(dev, edesc, areq, true); |
399 |
+ |
400 |
+ /* copy the generated ICV to dst */ |
401 |
+ if (edesc->icv_ool) { |
402 |
+@@ -1020,7 +1022,7 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev, |
403 |
+ |
404 |
+ edesc = container_of(desc, struct talitos_edesc, desc); |
405 |
+ |
406 |
+- ipsec_esp_unmap(dev, edesc, req); |
407 |
++ ipsec_esp_unmap(dev, edesc, req, false); |
408 |
+ |
409 |
+ if (!err) { |
410 |
+ char icvdata[SHA512_DIGEST_SIZE]; |
411 |
+@@ -1066,7 +1068,7 @@ static void ipsec_esp_decrypt_hwauth_done(struct device *dev, |
412 |
+ |
413 |
+ edesc = container_of(desc, struct talitos_edesc, desc); |
414 |
+ |
415 |
+- ipsec_esp_unmap(dev, edesc, req); |
416 |
++ ipsec_esp_unmap(dev, edesc, req, false); |
417 |
+ |
418 |
+ /* check ICV auth status */ |
419 |
+ if (!err && ((desc->hdr_lo & DESC_HDR_LO_ICCR1_MASK) != |
420 |
+@@ -1173,6 +1175,7 @@ static int talitos_sg_map(struct device *dev, struct scatterlist *src, |
421 |
+ * fill in and submit ipsec_esp descriptor |
422 |
+ */ |
423 |
+ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, |
424 |
++ bool encrypt, |
425 |
+ void (*callback)(struct device *dev, |
426 |
+ struct talitos_desc *desc, |
427 |
+ void *context, int error)) |
428 |
+@@ -1182,7 +1185,7 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, |
429 |
+ struct talitos_ctx *ctx = crypto_aead_ctx(aead); |
430 |
+ struct device *dev = ctx->dev; |
431 |
+ struct talitos_desc *desc = &edesc->desc; |
432 |
+- unsigned int cryptlen = areq->cryptlen; |
433 |
++ unsigned int cryptlen = areq->cryptlen - (encrypt ? 0 : authsize); |
434 |
+ unsigned int ivsize = crypto_aead_ivsize(aead); |
435 |
+ int tbl_off = 0; |
436 |
+ int sg_count, ret; |
437 |
+@@ -1324,7 +1327,7 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, |
438 |
+ |
439 |
+ ret = talitos_submit(dev, ctx->ch, desc, callback, areq); |
440 |
+ if (ret != -EINPROGRESS) { |
441 |
+- ipsec_esp_unmap(dev, edesc, areq); |
442 |
++ ipsec_esp_unmap(dev, edesc, areq, encrypt); |
443 |
+ kfree(edesc); |
444 |
+ } |
445 |
+ return ret; |
446 |
+@@ -1433,9 +1436,10 @@ static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv, |
447 |
+ unsigned int authsize = crypto_aead_authsize(authenc); |
448 |
+ struct talitos_ctx *ctx = crypto_aead_ctx(authenc); |
449 |
+ unsigned int ivsize = crypto_aead_ivsize(authenc); |
450 |
++ unsigned int cryptlen = areq->cryptlen - (encrypt ? 0 : authsize); |
451 |
+ |
452 |
+ return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst, |
453 |
+- iv, areq->assoclen, areq->cryptlen, |
454 |
++ iv, areq->assoclen, cryptlen, |
455 |
+ authsize, ivsize, icv_stashing, |
456 |
+ areq->base.flags, encrypt); |
457 |
+ } |
458 |
+@@ -1454,7 +1458,7 @@ static int aead_encrypt(struct aead_request *req) |
459 |
+ /* set encrypt */ |
460 |
+ edesc->desc.hdr = ctx->desc_hdr_template | DESC_HDR_MODE0_ENCRYPT; |
461 |
+ |
462 |
+- return ipsec_esp(edesc, req, ipsec_esp_encrypt_done); |
463 |
++ return ipsec_esp(edesc, req, true, ipsec_esp_encrypt_done); |
464 |
+ } |
465 |
+ |
466 |
+ static int aead_decrypt(struct aead_request *req) |
467 |
+@@ -1466,14 +1470,13 @@ static int aead_decrypt(struct aead_request *req) |
468 |
+ struct talitos_edesc *edesc; |
469 |
+ void *icvdata; |
470 |
+ |
471 |
+- req->cryptlen -= authsize; |
472 |
+- |
473 |
+ /* allocate extended descriptor */ |
474 |
+ edesc = aead_edesc_alloc(req, req->iv, 1, false); |
475 |
+ if (IS_ERR(edesc)) |
476 |
+ return PTR_ERR(edesc); |
477 |
+ |
478 |
+- if ((priv->features & TALITOS_FTR_HW_AUTH_CHECK) && |
479 |
++ if ((edesc->desc.hdr & DESC_HDR_TYPE_IPSEC_ESP) && |
480 |
++ (priv->features & TALITOS_FTR_HW_AUTH_CHECK) && |
481 |
+ ((!edesc->src_nents && !edesc->dst_nents) || |
482 |
+ priv->features & TALITOS_FTR_SRC_LINK_TBL_LEN_INCLUDES_EXTENT)) { |
483 |
+ |
484 |
+@@ -1485,7 +1488,8 @@ static int aead_decrypt(struct aead_request *req) |
485 |
+ /* reset integrity check result bits */ |
486 |
+ edesc->desc.hdr_lo = 0; |
487 |
+ |
488 |
+- return ipsec_esp(edesc, req, ipsec_esp_decrypt_hwauth_done); |
489 |
++ return ipsec_esp(edesc, req, false, |
490 |
++ ipsec_esp_decrypt_hwauth_done); |
491 |
+ } |
492 |
+ |
493 |
+ /* Have to check the ICV with software */ |
494 |
+@@ -1501,7 +1505,7 @@ static int aead_decrypt(struct aead_request *req) |
495 |
+ sg_pcopy_to_buffer(req->src, edesc->src_nents ? : 1, icvdata, authsize, |
496 |
+ req->assoclen + req->cryptlen - authsize); |
497 |
+ |
498 |
+- return ipsec_esp(edesc, req, ipsec_esp_decrypt_swauth_done); |
499 |
++ return ipsec_esp(edesc, req, false, ipsec_esp_decrypt_swauth_done); |
500 |
+ } |
501 |
+ |
502 |
+ static int ablkcipher_setkey(struct crypto_ablkcipher *cipher, |
503 |
+@@ -1528,6 +1532,18 @@ static int ablkcipher_setkey(struct crypto_ablkcipher *cipher, |
504 |
+ return 0; |
505 |
+ } |
506 |
+ |
507 |
++static int ablkcipher_aes_setkey(struct crypto_ablkcipher *cipher, |
508 |
++ const u8 *key, unsigned int keylen) |
509 |
++{ |
510 |
++ if (keylen == AES_KEYSIZE_128 || keylen == AES_KEYSIZE_192 || |
511 |
++ keylen == AES_KEYSIZE_256) |
512 |
++ return ablkcipher_setkey(cipher, key, keylen); |
513 |
++ |
514 |
++ crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); |
515 |
++ |
516 |
++ return -EINVAL; |
517 |
++} |
518 |
++ |
519 |
+ static void common_nonsnoop_unmap(struct device *dev, |
520 |
+ struct talitos_edesc *edesc, |
521 |
+ struct ablkcipher_request *areq) |
522 |
+@@ -1656,6 +1672,14 @@ static int ablkcipher_encrypt(struct ablkcipher_request *areq) |
523 |
+ struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); |
524 |
+ struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher); |
525 |
+ struct talitos_edesc *edesc; |
526 |
++ unsigned int blocksize = |
527 |
++ crypto_tfm_alg_blocksize(crypto_ablkcipher_tfm(cipher)); |
528 |
++ |
529 |
++ if (!areq->nbytes) |
530 |
++ return 0; |
531 |
++ |
532 |
++ if (areq->nbytes % blocksize) |
533 |
++ return -EINVAL; |
534 |
+ |
535 |
+ /* allocate extended descriptor */ |
536 |
+ edesc = ablkcipher_edesc_alloc(areq, true); |
537 |
+@@ -1673,6 +1697,14 @@ static int ablkcipher_decrypt(struct ablkcipher_request *areq) |
538 |
+ struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq); |
539 |
+ struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher); |
540 |
+ struct talitos_edesc *edesc; |
541 |
++ unsigned int blocksize = |
542 |
++ crypto_tfm_alg_blocksize(crypto_ablkcipher_tfm(cipher)); |
543 |
++ |
544 |
++ if (!areq->nbytes) |
545 |
++ return 0; |
546 |
++ |
547 |
++ if (areq->nbytes % blocksize) |
548 |
++ return -EINVAL; |
549 |
+ |
550 |
+ /* allocate extended descriptor */ |
551 |
+ edesc = ablkcipher_edesc_alloc(areq, false); |
552 |
+@@ -2621,6 +2653,7 @@ static struct talitos_alg_template driver_algs[] = { |
553 |
+ .min_keysize = AES_MIN_KEY_SIZE, |
554 |
+ .max_keysize = AES_MAX_KEY_SIZE, |
555 |
+ .ivsize = AES_BLOCK_SIZE, |
556 |
++ .setkey = ablkcipher_aes_setkey, |
557 |
+ } |
558 |
+ }, |
559 |
+ .desc_hdr_template = DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU | |
560 |
+@@ -2631,13 +2664,13 @@ static struct talitos_alg_template driver_algs[] = { |
561 |
+ .alg.crypto = { |
562 |
+ .cra_name = "ctr(aes)", |
563 |
+ .cra_driver_name = "ctr-aes-talitos", |
564 |
+- .cra_blocksize = AES_BLOCK_SIZE, |
565 |
++ .cra_blocksize = 1, |
566 |
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | |
567 |
+ CRYPTO_ALG_ASYNC, |
568 |
+ .cra_ablkcipher = { |
569 |
+ .min_keysize = AES_MIN_KEY_SIZE, |
570 |
+ .max_keysize = AES_MAX_KEY_SIZE, |
571 |
+- .ivsize = AES_BLOCK_SIZE, |
572 |
++ .setkey = ablkcipher_aes_setkey, |
573 |
+ } |
574 |
+ }, |
575 |
+ .desc_hdr_template = DESC_HDR_TYPE_AESU_CTR_NONSNOOP | |
576 |
+diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c |
577 |
+index 00cfed3c3e1a..1620722115cd 100644 |
578 |
+--- a/drivers/firmware/ti_sci.c |
579 |
++++ b/drivers/firmware/ti_sci.c |
580 |
+@@ -471,9 +471,9 @@ static int ti_sci_cmd_get_revision(struct ti_sci_info *info) |
581 |
+ struct ti_sci_xfer *xfer; |
582 |
+ int ret; |
583 |
+ |
584 |
+- /* No need to setup flags since it is expected to respond */ |
585 |
+ xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_VERSION, |
586 |
+- 0x0, sizeof(struct ti_sci_msg_hdr), |
587 |
++ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED, |
588 |
++ sizeof(struct ti_sci_msg_hdr), |
589 |
+ sizeof(*rev_info)); |
590 |
+ if (IS_ERR(xfer)) { |
591 |
+ ret = PTR_ERR(xfer); |
592 |
+@@ -601,9 +601,9 @@ static int ti_sci_get_device_state(const struct ti_sci_handle *handle, |
593 |
+ info = handle_to_ti_sci_info(handle); |
594 |
+ dev = info->dev; |
595 |
+ |
596 |
+- /* Response is expected, so need of any flags */ |
597 |
+ xfer = ti_sci_get_one_xfer(info, TI_SCI_MSG_GET_DEVICE_STATE, |
598 |
+- 0, sizeof(*req), sizeof(*resp)); |
599 |
++ TI_SCI_FLAG_REQ_ACK_ON_PROCESSED, |
600 |
++ sizeof(*req), sizeof(*resp)); |
601 |
+ if (IS_ERR(xfer)) { |
602 |
+ ret = PTR_ERR(xfer); |
603 |
+ dev_err(dev, "Message alloc failed(%d)\n", ret); |
604 |
+diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c |
605 |
+index 57d157e94bd6..715babaa886a 100644 |
606 |
+--- a/drivers/gpio/gpiolib-acpi.c |
607 |
++++ b/drivers/gpio/gpiolib-acpi.c |
608 |
+@@ -10,6 +10,7 @@ |
609 |
+ * published by the Free Software Foundation. |
610 |
+ */ |
611 |
+ |
612 |
++#include <linux/dmi.h> |
613 |
+ #include <linux/errno.h> |
614 |
+ #include <linux/gpio.h> |
615 |
+ #include <linux/gpio/consumer.h> |
616 |
+@@ -23,6 +24,11 @@ |
617 |
+ |
618 |
+ #include "gpiolib.h" |
619 |
+ |
620 |
++static int run_edge_events_on_boot = -1; |
621 |
++module_param(run_edge_events_on_boot, int, 0444); |
622 |
++MODULE_PARM_DESC(run_edge_events_on_boot, |
623 |
++ "Run edge _AEI event-handlers at boot: 0=no, 1=yes, -1=auto"); |
624 |
++ |
625 |
+ /** |
626 |
+ * struct acpi_gpio_event - ACPI GPIO event handler data |
627 |
+ * |
628 |
+@@ -231,10 +237,13 @@ static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio, |
629 |
+ event->irq_requested = true; |
630 |
+ |
631 |
+ /* Make sure we trigger the initial state of edge-triggered IRQs */ |
632 |
+- value = gpiod_get_raw_value_cansleep(event->desc); |
633 |
+- if (((event->irqflags & IRQF_TRIGGER_RISING) && value == 1) || |
634 |
+- ((event->irqflags & IRQF_TRIGGER_FALLING) && value == 0)) |
635 |
+- event->handler(event->irq, event); |
636 |
++ if (run_edge_events_on_boot && |
637 |
++ (event->irqflags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING))) { |
638 |
++ value = gpiod_get_raw_value_cansleep(event->desc); |
639 |
++ if (((event->irqflags & IRQF_TRIGGER_RISING) && value == 1) || |
640 |
++ ((event->irqflags & IRQF_TRIGGER_FALLING) && value == 0)) |
641 |
++ event->handler(event->irq, event); |
642 |
++ } |
643 |
+ } |
644 |
+ |
645 |
+ static void acpi_gpiochip_request_irqs(struct acpi_gpio_chip *acpi_gpio) |
646 |
+@@ -1302,3 +1311,28 @@ static int acpi_gpio_handle_deferred_request_irqs(void) |
647 |
+ } |
648 |
+ /* We must use _sync so that this runs after the first deferred_probe run */ |
649 |
+ late_initcall_sync(acpi_gpio_handle_deferred_request_irqs); |
650 |
++ |
651 |
++static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = { |
652 |
++ { |
653 |
++ .matches = { |
654 |
++ DMI_MATCH(DMI_SYS_VENDOR, "MINIX"), |
655 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"), |
656 |
++ } |
657 |
++ }, |
658 |
++ {} /* Terminating entry */ |
659 |
++}; |
660 |
++ |
661 |
++static int acpi_gpio_setup_params(void) |
662 |
++{ |
663 |
++ if (run_edge_events_on_boot < 0) { |
664 |
++ if (dmi_check_system(run_edge_events_on_boot_blacklist)) |
665 |
++ run_edge_events_on_boot = 0; |
666 |
++ else |
667 |
++ run_edge_events_on_boot = 1; |
668 |
++ } |
669 |
++ |
670 |
++ return 0; |
671 |
++} |
672 |
++ |
673 |
++/* Directly after dmi_setup() which runs as core_initcall() */ |
674 |
++postcore_initcall(acpi_gpio_setup_params); |
675 |
+diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c |
676 |
+index 562e90bf73c9..f1809a54fcee 100644 |
677 |
+--- a/drivers/gpio/gpiolib.c |
678 |
++++ b/drivers/gpio/gpiolib.c |
679 |
+@@ -444,12 +444,23 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip) |
680 |
+ struct linehandle_state *lh; |
681 |
+ struct file *file; |
682 |
+ int fd, i, count = 0, ret; |
683 |
++ u32 lflags; |
684 |
+ |
685 |
+ if (copy_from_user(&handlereq, ip, sizeof(handlereq))) |
686 |
+ return -EFAULT; |
687 |
+ if ((handlereq.lines == 0) || (handlereq.lines > GPIOHANDLES_MAX)) |
688 |
+ return -EINVAL; |
689 |
+ |
690 |
++ lflags = handlereq.flags; |
691 |
++ |
692 |
++ /* |
693 |
++ * Do not allow both INPUT & OUTPUT flags to be set as they are |
694 |
++ * contradictory. |
695 |
++ */ |
696 |
++ if ((lflags & GPIOHANDLE_REQUEST_INPUT) && |
697 |
++ (lflags & GPIOHANDLE_REQUEST_OUTPUT)) |
698 |
++ return -EINVAL; |
699 |
++ |
700 |
+ lh = kzalloc(sizeof(*lh), GFP_KERNEL); |
701 |
+ if (!lh) |
702 |
+ return -ENOMEM; |
703 |
+@@ -470,7 +481,6 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip) |
704 |
+ /* Request each GPIO */ |
705 |
+ for (i = 0; i < handlereq.lines; i++) { |
706 |
+ u32 offset = handlereq.lineoffsets[i]; |
707 |
+- u32 lflags = handlereq.flags; |
708 |
+ struct gpio_desc *desc; |
709 |
+ |
710 |
+ if (offset >= gdev->ngpio) { |
711 |
+@@ -805,7 +815,9 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) |
712 |
+ } |
713 |
+ |
714 |
+ /* This is just wrong: we don't look for events on output lines */ |
715 |
+- if (lflags & GPIOHANDLE_REQUEST_OUTPUT) { |
716 |
++ if ((lflags & GPIOHANDLE_REQUEST_OUTPUT) || |
717 |
++ (lflags & GPIOHANDLE_REQUEST_OPEN_DRAIN) || |
718 |
++ (lflags & GPIOHANDLE_REQUEST_OPEN_SOURCE)) { |
719 |
+ ret = -EINVAL; |
720 |
+ goto out_free_label; |
721 |
+ } |
722 |
+@@ -819,10 +831,6 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) |
723 |
+ |
724 |
+ if (lflags & GPIOHANDLE_REQUEST_ACTIVE_LOW) |
725 |
+ set_bit(FLAG_ACTIVE_LOW, &desc->flags); |
726 |
+- if (lflags & GPIOHANDLE_REQUEST_OPEN_DRAIN) |
727 |
+- set_bit(FLAG_OPEN_DRAIN, &desc->flags); |
728 |
+- if (lflags & GPIOHANDLE_REQUEST_OPEN_SOURCE) |
729 |
+- set_bit(FLAG_OPEN_SOURCE, &desc->flags); |
730 |
+ |
731 |
+ ret = gpiod_direction_input(desc); |
732 |
+ if (ret) |
733 |
+diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c |
734 |
+index 034b50080304..670662128edd 100644 |
735 |
+--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c |
736 |
++++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c |
737 |
+@@ -504,12 +504,15 @@ static int mtk_drm_probe(struct platform_device *pdev) |
738 |
+ comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL); |
739 |
+ if (!comp) { |
740 |
+ ret = -ENOMEM; |
741 |
++ of_node_put(node); |
742 |
+ goto err_node; |
743 |
+ } |
744 |
+ |
745 |
+ ret = mtk_ddp_comp_init(dev, node, comp, comp_id, NULL); |
746 |
+- if (ret) |
747 |
++ if (ret) { |
748 |
++ of_node_put(node); |
749 |
+ goto err_node; |
750 |
++ } |
751 |
+ |
752 |
+ private->ddp_comp[comp_id] = comp; |
753 |
+ } |
754 |
+diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c |
755 |
+index 0b6011b8d632..85fa39e2be34 100644 |
756 |
+--- a/drivers/gpu/drm/meson/meson_plane.c |
757 |
++++ b/drivers/gpu/drm/meson/meson_plane.c |
758 |
+@@ -124,6 +124,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane, |
759 |
+ priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 | |
760 |
+ OSD_COLOR_MATRIX_32_ARGB; |
761 |
+ break; |
762 |
++ case DRM_FORMAT_XBGR8888: |
763 |
++ /* For XRGB, replace the pixel's alpha by 0xFF */ |
764 |
++ writel_bits_relaxed(OSD_REPLACE_EN, OSD_REPLACE_EN, |
765 |
++ priv->io_base + _REG(VIU_OSD1_CTRL_STAT2)); |
766 |
++ priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 | |
767 |
++ OSD_COLOR_MATRIX_32_ABGR; |
768 |
++ break; |
769 |
+ case DRM_FORMAT_ARGB8888: |
770 |
+ /* For ARGB, use the pixel's alpha */ |
771 |
+ writel_bits_relaxed(OSD_REPLACE_EN, 0, |
772 |
+@@ -131,6 +138,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane, |
773 |
+ priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 | |
774 |
+ OSD_COLOR_MATRIX_32_ARGB; |
775 |
+ break; |
776 |
++ case DRM_FORMAT_ABGR8888: |
777 |
++ /* For ARGB, use the pixel's alpha */ |
778 |
++ writel_bits_relaxed(OSD_REPLACE_EN, 0, |
779 |
++ priv->io_base + _REG(VIU_OSD1_CTRL_STAT2)); |
780 |
++ priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_32 | |
781 |
++ OSD_COLOR_MATRIX_32_ABGR; |
782 |
++ break; |
783 |
+ case DRM_FORMAT_RGB888: |
784 |
+ priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_24 | |
785 |
+ OSD_COLOR_MATRIX_24_RGB; |
786 |
+@@ -200,7 +214,9 @@ static const struct drm_plane_funcs meson_plane_funcs = { |
787 |
+ |
788 |
+ static const uint32_t supported_drm_formats[] = { |
789 |
+ DRM_FORMAT_ARGB8888, |
790 |
++ DRM_FORMAT_ABGR8888, |
791 |
+ DRM_FORMAT_XRGB8888, |
792 |
++ DRM_FORMAT_XBGR8888, |
793 |
+ DRM_FORMAT_RGB888, |
794 |
+ DRM_FORMAT_RGB565, |
795 |
+ }; |
796 |
+diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c |
797 |
+index dde8f46bc254..91efbf0f19f9 100644 |
798 |
+--- a/drivers/isdn/capi/capi.c |
799 |
++++ b/drivers/isdn/capi/capi.c |
800 |
+@@ -687,6 +687,9 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos |
801 |
+ if (!cdev->ap.applid) |
802 |
+ return -ENODEV; |
803 |
+ |
804 |
++ if (count < CAPIMSG_BASELEN) |
805 |
++ return -EINVAL; |
806 |
++ |
807 |
+ skb = alloc_skb(count, GFP_USER); |
808 |
+ if (!skb) |
809 |
+ return -ENOMEM; |
810 |
+@@ -697,7 +700,8 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos |
811 |
+ } |
812 |
+ mlen = CAPIMSG_LEN(skb->data); |
813 |
+ if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) { |
814 |
+- if ((size_t)(mlen + CAPIMSG_DATALEN(skb->data)) != count) { |
815 |
++ if (count < CAPI_DATA_B3_REQ_LEN || |
816 |
++ (size_t)(mlen + CAPIMSG_DATALEN(skb->data)) != count) { |
817 |
+ kfree_skb(skb); |
818 |
+ return -EINVAL; |
819 |
+ } |
820 |
+@@ -710,6 +714,10 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos |
821 |
+ CAPIMSG_SETAPPID(skb->data, cdev->ap.applid); |
822 |
+ |
823 |
+ if (CAPIMSG_CMD(skb->data) == CAPI_DISCONNECT_B3_RESP) { |
824 |
++ if (count < CAPI_DISCONNECT_B3_RESP_LEN) { |
825 |
++ kfree_skb(skb); |
826 |
++ return -EINVAL; |
827 |
++ } |
828 |
+ mutex_lock(&cdev->lock); |
829 |
+ capincci_free(cdev, CAPIMSG_NCCI(skb->data)); |
830 |
+ mutex_unlock(&cdev->lock); |
831 |
+diff --git a/drivers/mtd/nand/mtk_nand.c b/drivers/mtd/nand/mtk_nand.c |
832 |
+index d86a7d131cc0..e17f838b9b81 100644 |
833 |
+--- a/drivers/mtd/nand/mtk_nand.c |
834 |
++++ b/drivers/mtd/nand/mtk_nand.c |
835 |
+@@ -846,19 +846,21 @@ static int mtk_nfc_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip, |
836 |
+ return ret & NAND_STATUS_FAIL ? -EIO : 0; |
837 |
+ } |
838 |
+ |
839 |
+-static int mtk_nfc_update_ecc_stats(struct mtd_info *mtd, u8 *buf, u32 sectors) |
840 |
++static int mtk_nfc_update_ecc_stats(struct mtd_info *mtd, u8 *buf, u32 start, |
841 |
++ u32 sectors) |
842 |
+ { |
843 |
+ struct nand_chip *chip = mtd_to_nand(mtd); |
844 |
+ struct mtk_nfc *nfc = nand_get_controller_data(chip); |
845 |
+ struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); |
846 |
+ struct mtk_ecc_stats stats; |
847 |
++ u32 reg_size = mtk_nand->fdm.reg_size; |
848 |
+ int rc, i; |
849 |
+ |
850 |
+ rc = nfi_readl(nfc, NFI_STA) & STA_EMP_PAGE; |
851 |
+ if (rc) { |
852 |
+ memset(buf, 0xff, sectors * chip->ecc.size); |
853 |
+ for (i = 0; i < sectors; i++) |
854 |
+- memset(oob_ptr(chip, i), 0xff, mtk_nand->fdm.reg_size); |
855 |
++ memset(oob_ptr(chip, start + i), 0xff, reg_size); |
856 |
+ return 0; |
857 |
+ } |
858 |
+ |
859 |
+@@ -878,7 +880,7 @@ static int mtk_nfc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, |
860 |
+ u32 spare = mtk_nand->spare_per_sector; |
861 |
+ u32 column, sectors, start, end, reg; |
862 |
+ dma_addr_t addr; |
863 |
+- int bitflips; |
864 |
++ int bitflips = 0; |
865 |
+ size_t len; |
866 |
+ u8 *buf; |
867 |
+ int rc; |
868 |
+@@ -946,14 +948,11 @@ static int mtk_nfc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, |
869 |
+ if (rc < 0) { |
870 |
+ dev_err(nfc->dev, "subpage done timeout\n"); |
871 |
+ bitflips = -EIO; |
872 |
+- } else { |
873 |
+- bitflips = 0; |
874 |
+- if (!raw) { |
875 |
+- rc = mtk_ecc_wait_done(nfc->ecc, ECC_DECODE); |
876 |
+- bitflips = rc < 0 ? -ETIMEDOUT : |
877 |
+- mtk_nfc_update_ecc_stats(mtd, buf, sectors); |
878 |
+- mtk_nfc_read_fdm(chip, start, sectors); |
879 |
+- } |
880 |
++ } else if (!raw) { |
881 |
++ rc = mtk_ecc_wait_done(nfc->ecc, ECC_DECODE); |
882 |
++ bitflips = rc < 0 ? -ETIMEDOUT : |
883 |
++ mtk_nfc_update_ecc_stats(mtd, buf, start, sectors); |
884 |
++ mtk_nfc_read_fdm(chip, start, sectors); |
885 |
+ } |
886 |
+ |
887 |
+ dma_unmap_single(nfc->dev, addr, len, DMA_FROM_DEVICE); |
888 |
+diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c |
889 |
+index 5b13c2ba1059..17acecfda542 100644 |
890 |
+--- a/drivers/net/phy/phylink.c |
891 |
++++ b/drivers/net/phy/phylink.c |
892 |
+@@ -359,8 +359,8 @@ static void phylink_get_fixed_state(struct phylink *pl, struct phylink_link_stat |
893 |
+ * Local device Link partner |
894 |
+ * Pause AsymDir Pause AsymDir Result |
895 |
+ * 1 X 1 X TX+RX |
896 |
+- * 0 1 1 1 RX |
897 |
+- * 1 1 0 1 TX |
898 |
++ * 0 1 1 1 TX |
899 |
++ * 1 1 0 1 RX |
900 |
+ */ |
901 |
+ static void phylink_resolve_flow(struct phylink *pl, |
902 |
+ struct phylink_link_state *state) |
903 |
+@@ -381,7 +381,7 @@ static void phylink_resolve_flow(struct phylink *pl, |
904 |
+ new_pause = MLO_PAUSE_TX | MLO_PAUSE_RX; |
905 |
+ else if (pause & MLO_PAUSE_ASYM) |
906 |
+ new_pause = state->pause & MLO_PAUSE_SYM ? |
907 |
+- MLO_PAUSE_RX : MLO_PAUSE_TX; |
908 |
++ MLO_PAUSE_TX : MLO_PAUSE_RX; |
909 |
+ } else { |
910 |
+ new_pause = pl->link_config.pause & MLO_PAUSE_TXRX_MASK; |
911 |
+ } |
912 |
+diff --git a/drivers/net/tun.c b/drivers/net/tun.c |
913 |
+index 7e197ba8abe4..3086211829a7 100644 |
914 |
+--- a/drivers/net/tun.c |
915 |
++++ b/drivers/net/tun.c |
916 |
+@@ -630,7 +630,8 @@ static void tun_detach_all(struct net_device *dev) |
917 |
+ module_put(THIS_MODULE); |
918 |
+ } |
919 |
+ |
920 |
+-static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filter) |
921 |
++static int tun_attach(struct tun_struct *tun, struct file *file, |
922 |
++ bool skip_filter, bool publish_tun) |
923 |
+ { |
924 |
+ struct tun_file *tfile = file->private_data; |
925 |
+ struct net_device *dev = tun->dev; |
926 |
+@@ -672,7 +673,8 @@ static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filte |
927 |
+ |
928 |
+ tfile->queue_index = tun->numqueues; |
929 |
+ tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN; |
930 |
+- rcu_assign_pointer(tfile->tun, tun); |
931 |
++ if (publish_tun) |
932 |
++ rcu_assign_pointer(tfile->tun, tun); |
933 |
+ rcu_assign_pointer(tun->tfiles[tun->numqueues], tfile); |
934 |
+ tun->numqueues++; |
935 |
+ |
936 |
+@@ -2011,7 +2013,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) |
937 |
+ if (err < 0) |
938 |
+ return err; |
939 |
+ |
940 |
+- err = tun_attach(tun, file, ifr->ifr_flags & IFF_NOFILTER); |
941 |
++ err = tun_attach(tun, file, ifr->ifr_flags & IFF_NOFILTER, true); |
942 |
+ if (err < 0) |
943 |
+ return err; |
944 |
+ |
945 |
+@@ -2100,13 +2102,17 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) |
946 |
+ NETIF_F_HW_VLAN_STAG_TX); |
947 |
+ |
948 |
+ INIT_LIST_HEAD(&tun->disabled); |
949 |
+- err = tun_attach(tun, file, false); |
950 |
++ err = tun_attach(tun, file, false, false); |
951 |
+ if (err < 0) |
952 |
+ goto err_free_flow; |
953 |
+ |
954 |
+ err = register_netdevice(tun->dev); |
955 |
+ if (err < 0) |
956 |
+ goto err_detach; |
957 |
++ /* free_netdev() won't check refcnt, to aovid race |
958 |
++ * with dev_put() we need publish tun after registration. |
959 |
++ */ |
960 |
++ rcu_assign_pointer(tfile->tun, tun); |
961 |
+ } |
962 |
+ |
963 |
+ netif_carrier_on(tun->dev); |
964 |
+@@ -2252,7 +2258,7 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr) |
965 |
+ ret = security_tun_dev_attach_queue(tun->security); |
966 |
+ if (ret < 0) |
967 |
+ goto unlock; |
968 |
+- ret = tun_attach(tun, file, false); |
969 |
++ ret = tun_attach(tun, file, false, true); |
970 |
+ } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { |
971 |
+ tun = rtnl_dereference(tfile->tun); |
972 |
+ if (!tun || !(tun->flags & IFF_MULTI_QUEUE) || tfile->detached) |
973 |
+diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c |
974 |
+index 178b956501a7..ffd15f5f836f 100644 |
975 |
+--- a/drivers/net/usb/cdc_ether.c |
976 |
++++ b/drivers/net/usb/cdc_ether.c |
977 |
+@@ -221,9 +221,16 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) |
978 |
+ goto bad_desc; |
979 |
+ } |
980 |
+ skip: |
981 |
+- if ( rndis && |
982 |
+- header.usb_cdc_acm_descriptor && |
983 |
+- header.usb_cdc_acm_descriptor->bmCapabilities) { |
984 |
++ /* Communcation class functions with bmCapabilities are not |
985 |
++ * RNDIS. But some Wireless class RNDIS functions use |
986 |
++ * bmCapabilities for their own purpose. The failsafe is |
987 |
++ * therefore applied only to Communication class RNDIS |
988 |
++ * functions. The rndis test is redundant, but a cheap |
989 |
++ * optimization. |
990 |
++ */ |
991 |
++ if (rndis && is_rndis(&intf->cur_altsetting->desc) && |
992 |
++ header.usb_cdc_acm_descriptor && |
993 |
++ header.usb_cdc_acm_descriptor->bmCapabilities) { |
994 |
+ dev_dbg(&intf->dev, |
995 |
+ "ACM capabilities %02x, not really RNDIS?\n", |
996 |
+ header.usb_cdc_acm_descriptor->bmCapabilities); |
997 |
+diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c |
998 |
+index dba3f4d0a63d..b414d9d207d4 100644 |
999 |
+--- a/drivers/nvmem/core.c |
1000 |
++++ b/drivers/nvmem/core.c |
1001 |
+@@ -407,10 +407,17 @@ static int nvmem_setup_compat(struct nvmem_device *nvmem, |
1002 |
+ if (!config->base_dev) |
1003 |
+ return -EINVAL; |
1004 |
+ |
1005 |
+- if (nvmem->read_only) |
1006 |
+- nvmem->eeprom = bin_attr_ro_root_nvmem; |
1007 |
+- else |
1008 |
+- nvmem->eeprom = bin_attr_rw_root_nvmem; |
1009 |
++ if (nvmem->read_only) { |
1010 |
++ if (config->root_only) |
1011 |
++ nvmem->eeprom = bin_attr_ro_root_nvmem; |
1012 |
++ else |
1013 |
++ nvmem->eeprom = bin_attr_ro_nvmem; |
1014 |
++ } else { |
1015 |
++ if (config->root_only) |
1016 |
++ nvmem->eeprom = bin_attr_rw_root_nvmem; |
1017 |
++ else |
1018 |
++ nvmem->eeprom = bin_attr_rw_nvmem; |
1019 |
++ } |
1020 |
+ nvmem->eeprom.attr.name = "eeprom"; |
1021 |
+ nvmem->eeprom.size = nvmem->size; |
1022 |
+ #ifdef CONFIG_DEBUG_LOCK_ALLOC |
1023 |
+diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c |
1024 |
+index e5a8bf2c9b37..7e4bec75fcde 100644 |
1025 |
+--- a/drivers/pci/pci-driver.c |
1026 |
++++ b/drivers/pci/pci-driver.c |
1027 |
+@@ -400,7 +400,8 @@ void __weak pcibios_free_irq(struct pci_dev *dev) |
1028 |
+ #ifdef CONFIG_PCI_IOV |
1029 |
+ static inline bool pci_device_can_probe(struct pci_dev *pdev) |
1030 |
+ { |
1031 |
+- return (!pdev->is_virtfn || pdev->physfn->sriov->drivers_autoprobe); |
1032 |
++ return (!pdev->is_virtfn || pdev->physfn->sriov->drivers_autoprobe || |
1033 |
++ pdev->driver_override); |
1034 |
+ } |
1035 |
+ #else |
1036 |
+ static inline bool pci_device_can_probe(struct pci_dev *pdev) |
1037 |
+diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c |
1038 |
+index d4d089c37944..63a6881c7078 100644 |
1039 |
+--- a/drivers/platform/x86/pmc_atom.c |
1040 |
++++ b/drivers/platform/x86/pmc_atom.c |
1041 |
+@@ -451,6 +451,14 @@ static const struct dmi_system_id critclk_systems[] = { |
1042 |
+ DMI_MATCH(DMI_BOARD_NAME, "CB3163"), |
1043 |
+ }, |
1044 |
+ }, |
1045 |
++ { |
1046 |
++ /* pmc_plt_clk* - are used for ethernet controllers */ |
1047 |
++ .ident = "Beckhoff CB4063", |
1048 |
++ .matches = { |
1049 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Beckhoff Automation"), |
1050 |
++ DMI_MATCH(DMI_BOARD_NAME, "CB4063"), |
1051 |
++ }, |
1052 |
++ }, |
1053 |
+ { |
1054 |
+ /* pmc_plt_clk* - are used for ethernet controllers */ |
1055 |
+ .ident = "Beckhoff CB6263", |
1056 |
+diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c |
1057 |
+index 280384bf34f1..ccd9c709375e 100644 |
1058 |
+--- a/fs/btrfs/compression.c |
1059 |
++++ b/fs/btrfs/compression.c |
1060 |
+@@ -43,6 +43,37 @@ |
1061 |
+ #include "extent_io.h" |
1062 |
+ #include "extent_map.h" |
1063 |
+ |
1064 |
++static const char* const btrfs_compress_types[] = { "", "zlib", "lzo", "zstd" }; |
1065 |
++ |
1066 |
++const char* btrfs_compress_type2str(enum btrfs_compression_type type) |
1067 |
++{ |
1068 |
++ switch (type) { |
1069 |
++ case BTRFS_COMPRESS_ZLIB: |
1070 |
++ case BTRFS_COMPRESS_LZO: |
1071 |
++ case BTRFS_COMPRESS_ZSTD: |
1072 |
++ case BTRFS_COMPRESS_NONE: |
1073 |
++ return btrfs_compress_types[type]; |
1074 |
++ } |
1075 |
++ |
1076 |
++ return NULL; |
1077 |
++} |
1078 |
++ |
1079 |
++bool btrfs_compress_is_valid_type(const char *str, size_t len) |
1080 |
++{ |
1081 |
++ int i; |
1082 |
++ |
1083 |
++ for (i = 1; i < ARRAY_SIZE(btrfs_compress_types); i++) { |
1084 |
++ size_t comp_len = strlen(btrfs_compress_types[i]); |
1085 |
++ |
1086 |
++ if (len < comp_len) |
1087 |
++ continue; |
1088 |
++ |
1089 |
++ if (!strncmp(btrfs_compress_types[i], str, comp_len)) |
1090 |
++ return true; |
1091 |
++ } |
1092 |
++ return false; |
1093 |
++} |
1094 |
++ |
1095 |
+ static int btrfs_decompress_bio(struct compressed_bio *cb); |
1096 |
+ |
1097 |
+ static inline int compressed_bio_size(struct btrfs_fs_info *fs_info, |
1098 |
+diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h |
1099 |
+index d2781ff8f994..0b185e277df4 100644 |
1100 |
+--- a/fs/btrfs/compression.h |
1101 |
++++ b/fs/btrfs/compression.h |
1102 |
+@@ -130,6 +130,9 @@ extern const struct btrfs_compress_op btrfs_zlib_compress; |
1103 |
+ extern const struct btrfs_compress_op btrfs_lzo_compress; |
1104 |
+ extern const struct btrfs_compress_op btrfs_zstd_compress; |
1105 |
+ |
1106 |
++const char* btrfs_compress_type2str(enum btrfs_compression_type type); |
1107 |
++bool btrfs_compress_is_valid_type(const char *str, size_t len); |
1108 |
++ |
1109 |
+ int btrfs_compress_heuristic(struct inode *inode, u64 start, u64 end); |
1110 |
+ |
1111 |
+ #endif |
1112 |
+diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c |
1113 |
+index 266f9069307b..b9c7d8508e35 100644 |
1114 |
+--- a/fs/btrfs/props.c |
1115 |
++++ b/fs/btrfs/props.c |
1116 |
+@@ -386,11 +386,7 @@ int btrfs_subvol_inherit_props(struct btrfs_trans_handle *trans, |
1117 |
+ |
1118 |
+ static int prop_compression_validate(const char *value, size_t len) |
1119 |
+ { |
1120 |
+- if (!strncmp("lzo", value, 3)) |
1121 |
+- return 0; |
1122 |
+- else if (!strncmp("zlib", value, 4)) |
1123 |
+- return 0; |
1124 |
+- else if (!strncmp("zstd", value, 4)) |
1125 |
++ if (btrfs_compress_is_valid_type(value, len)) |
1126 |
+ return 0; |
1127 |
+ |
1128 |
+ return -EINVAL; |
1129 |
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c |
1130 |
+index bfd7c89c8d92..f8ef2e3fbf63 100644 |
1131 |
+--- a/fs/btrfs/tree-log.c |
1132 |
++++ b/fs/btrfs/tree-log.c |
1133 |
+@@ -5122,7 +5122,7 @@ again: |
1134 |
+ BTRFS_I(other_inode), |
1135 |
+ LOG_OTHER_INODE, 0, LLONG_MAX, |
1136 |
+ ctx); |
1137 |
+- iput(other_inode); |
1138 |
++ btrfs_add_delayed_iput(other_inode); |
1139 |
+ if (err) |
1140 |
+ goto out_unlock; |
1141 |
+ else |
1142 |
+@@ -5539,7 +5539,7 @@ process_leaf: |
1143 |
+ } |
1144 |
+ |
1145 |
+ if (btrfs_inode_in_log(BTRFS_I(di_inode), trans->transid)) { |
1146 |
+- iput(di_inode); |
1147 |
++ btrfs_add_delayed_iput(di_inode); |
1148 |
+ break; |
1149 |
+ } |
1150 |
+ |
1151 |
+@@ -5551,7 +5551,7 @@ process_leaf: |
1152 |
+ if (!ret && |
1153 |
+ btrfs_must_commit_transaction(trans, BTRFS_I(di_inode))) |
1154 |
+ ret = 1; |
1155 |
+- iput(di_inode); |
1156 |
++ btrfs_add_delayed_iput(di_inode); |
1157 |
+ if (ret) |
1158 |
+ goto next_dir_inode; |
1159 |
+ if (ctx->log_new_dentries) { |
1160 |
+@@ -5698,7 +5698,7 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans, |
1161 |
+ if (!ret && ctx && ctx->log_new_dentries) |
1162 |
+ ret = log_new_dir_dentries(trans, root, |
1163 |
+ BTRFS_I(dir_inode), ctx); |
1164 |
+- iput(dir_inode); |
1165 |
++ btrfs_add_delayed_iput(dir_inode); |
1166 |
+ if (ret) |
1167 |
+ goto out; |
1168 |
+ } |
1169 |
+diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c |
1170 |
+index ba3d0e0f8615..c7828db206bc 100644 |
1171 |
+--- a/fs/ubifs/tnc.c |
1172 |
++++ b/fs/ubifs/tnc.c |
1173 |
+@@ -1164,8 +1164,8 @@ static struct ubifs_znode *dirty_cow_bottom_up(struct ubifs_info *c, |
1174 |
+ * o exact match, i.e. the found zero-level znode contains key @key, then %1 |
1175 |
+ * is returned and slot number of the matched branch is stored in @n; |
1176 |
+ * o not exact match, which means that zero-level znode does not contain |
1177 |
+- * @key, then %0 is returned and slot number of the closest branch is stored |
1178 |
+- * in @n; |
1179 |
++ * @key, then %0 is returned and slot number of the closest branch or %-1 |
1180 |
++ * is stored in @n; In this case calling tnc_next() is mandatory. |
1181 |
+ * o @key is so small that it is even less than the lowest key of the |
1182 |
+ * leftmost zero-level node, then %0 is returned and %0 is stored in @n. |
1183 |
+ * |
1184 |
+@@ -1882,13 +1882,19 @@ int ubifs_tnc_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, |
1185 |
+ |
1186 |
+ static int search_dh_cookie(struct ubifs_info *c, const union ubifs_key *key, |
1187 |
+ struct ubifs_dent_node *dent, uint32_t cookie, |
1188 |
+- struct ubifs_znode **zn, int *n) |
1189 |
++ struct ubifs_znode **zn, int *n, int exact) |
1190 |
+ { |
1191 |
+ int err; |
1192 |
+ struct ubifs_znode *znode = *zn; |
1193 |
+ struct ubifs_zbranch *zbr; |
1194 |
+ union ubifs_key *dkey; |
1195 |
+ |
1196 |
++ if (!exact) { |
1197 |
++ err = tnc_next(c, &znode, n); |
1198 |
++ if (err) |
1199 |
++ return err; |
1200 |
++ } |
1201 |
++ |
1202 |
+ for (;;) { |
1203 |
+ zbr = &znode->zbranch[*n]; |
1204 |
+ dkey = &zbr->key; |
1205 |
+@@ -1930,7 +1936,7 @@ static int do_lookup_dh(struct ubifs_info *c, const union ubifs_key *key, |
1206 |
+ if (unlikely(err < 0)) |
1207 |
+ goto out_unlock; |
1208 |
+ |
1209 |
+- err = search_dh_cookie(c, key, dent, cookie, &znode, &n); |
1210 |
++ err = search_dh_cookie(c, key, dent, cookie, &znode, &n, err); |
1211 |
+ |
1212 |
+ out_unlock: |
1213 |
+ mutex_unlock(&c->tnc_mutex); |
1214 |
+@@ -2716,7 +2722,7 @@ int ubifs_tnc_remove_dh(struct ubifs_info *c, const union ubifs_key *key, |
1215 |
+ if (unlikely(err < 0)) |
1216 |
+ goto out_free; |
1217 |
+ |
1218 |
+- err = search_dh_cookie(c, key, dent, cookie, &znode, &n); |
1219 |
++ err = search_dh_cookie(c, key, dent, cookie, &znode, &n, err); |
1220 |
+ if (err) |
1221 |
+ goto out_free; |
1222 |
+ } |
1223 |
+diff --git a/include/uapi/linux/isdn/capicmd.h b/include/uapi/linux/isdn/capicmd.h |
1224 |
+index 4941628a4fb9..5ec88e7548a9 100644 |
1225 |
+--- a/include/uapi/linux/isdn/capicmd.h |
1226 |
++++ b/include/uapi/linux/isdn/capicmd.h |
1227 |
+@@ -16,6 +16,7 @@ |
1228 |
+ #define CAPI_MSG_BASELEN 8 |
1229 |
+ #define CAPI_DATA_B3_REQ_LEN (CAPI_MSG_BASELEN+4+4+2+2+2) |
1230 |
+ #define CAPI_DATA_B3_RESP_LEN (CAPI_MSG_BASELEN+4+2) |
1231 |
++#define CAPI_DISCONNECT_B3_RESP_LEN (CAPI_MSG_BASELEN+4) |
1232 |
+ |
1233 |
+ /*----- CAPI commands -----*/ |
1234 |
+ #define CAPI_ALERT 0x01 |
1235 |
+diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c |
1236 |
+index 1d08f45135c2..f7a9cfe63380 100644 |
1237 |
+--- a/kernel/irq/resend.c |
1238 |
++++ b/kernel/irq/resend.c |
1239 |
+@@ -38,6 +38,8 @@ static void resend_irqs(unsigned long arg) |
1240 |
+ irq = find_first_bit(irqs_resend, nr_irqs); |
1241 |
+ clear_bit(irq, irqs_resend); |
1242 |
+ desc = irq_to_desc(irq); |
1243 |
++ if (!desc) |
1244 |
++ continue; |
1245 |
+ local_irq_disable(); |
1246 |
+ desc->handle_irq(desc); |
1247 |
+ local_irq_enable(); |
1248 |
+diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c |
1249 |
+index 31ddff22563e..a7e98e52b122 100644 |
1250 |
+--- a/net/bridge/br_mdb.c |
1251 |
++++ b/net/bridge/br_mdb.c |
1252 |
+@@ -373,7 +373,7 @@ static int nlmsg_populate_rtr_fill(struct sk_buff *skb, |
1253 |
+ struct nlmsghdr *nlh; |
1254 |
+ struct nlattr *nest; |
1255 |
+ |
1256 |
+- nlh = nlmsg_put(skb, pid, seq, type, sizeof(*bpm), NLM_F_MULTI); |
1257 |
++ nlh = nlmsg_put(skb, pid, seq, type, sizeof(*bpm), 0); |
1258 |
+ if (!nlh) |
1259 |
+ return -EMSGSIZE; |
1260 |
+ |
1261 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
1262 |
+index f79b513e80dc..9d6beb9de924 100644 |
1263 |
+--- a/net/core/dev.c |
1264 |
++++ b/net/core/dev.c |
1265 |
+@@ -7698,6 +7698,8 @@ int register_netdevice(struct net_device *dev) |
1266 |
+ ret = notifier_to_errno(ret); |
1267 |
+ if (ret) { |
1268 |
+ rollback_registered(dev); |
1269 |
++ rcu_barrier(); |
1270 |
++ |
1271 |
+ dev->reg_state = NETREG_UNREGISTERED; |
1272 |
+ } |
1273 |
+ /* |
1274 |
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
1275 |
+index 6d9fd7d4bdfa..b1933e1f3aef 100644 |
1276 |
+--- a/net/core/skbuff.c |
1277 |
++++ b/net/core/skbuff.c |
1278 |
+@@ -3514,6 +3514,25 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, |
1279 |
+ int pos; |
1280 |
+ int dummy; |
1281 |
+ |
1282 |
++ if (list_skb && !list_skb->head_frag && skb_headlen(list_skb) && |
1283 |
++ (skb_shinfo(head_skb)->gso_type & SKB_GSO_DODGY)) { |
1284 |
++ /* gso_size is untrusted, and we have a frag_list with a linear |
1285 |
++ * non head_frag head. |
1286 |
++ * |
1287 |
++ * (we assume checking the first list_skb member suffices; |
1288 |
++ * i.e if either of the list_skb members have non head_frag |
1289 |
++ * head, then the first one has too). |
1290 |
++ * |
1291 |
++ * If head_skb's headlen does not fit requested gso_size, it |
1292 |
++ * means that the frag_list members do NOT terminate on exact |
1293 |
++ * gso_size boundaries. Hence we cannot perform skb_frag_t page |
1294 |
++ * sharing. Therefore we must fallback to copying the frag_list |
1295 |
++ * skbs; we do so by disabling SG. |
1296 |
++ */ |
1297 |
++ if (mss != GSO_BY_FRAGS && mss != skb_headlen(head_skb)) |
1298 |
++ features &= ~NETIF_F_SG; |
1299 |
++ } |
1300 |
++ |
1301 |
+ __skb_push(head_skb, doffset); |
1302 |
+ proto = skb_network_protocol(head_skb, &dummy); |
1303 |
+ if (unlikely(!proto)) |
1304 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
1305 |
+index 8e080f3b75bd..55253ba0681f 100644 |
1306 |
+--- a/net/ipv4/tcp_input.c |
1307 |
++++ b/net/ipv4/tcp_input.c |
1308 |
+@@ -247,7 +247,7 @@ static void tcp_ecn_accept_cwr(struct tcp_sock *tp, const struct sk_buff *skb) |
1309 |
+ |
1310 |
+ static void tcp_ecn_withdraw_cwr(struct tcp_sock *tp) |
1311 |
+ { |
1312 |
+- tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR; |
1313 |
++ tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR; |
1314 |
+ } |
1315 |
+ |
1316 |
+ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) |
1317 |
+diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c |
1318 |
+index ac826dd338ff..d5cdba8213a4 100644 |
1319 |
+--- a/net/ipv6/ping.c |
1320 |
++++ b/net/ipv6/ping.c |
1321 |
+@@ -233,7 +233,7 @@ static int __net_init ping_v6_proc_init_net(struct net *net) |
1322 |
+ return ping_proc_register(net, &ping_v6_seq_afinfo); |
1323 |
+ } |
1324 |
+ |
1325 |
+-static void __net_init ping_v6_proc_exit_net(struct net *net) |
1326 |
++static void __net_exit ping_v6_proc_exit_net(struct net *net) |
1327 |
+ { |
1328 |
+ return ping_proc_unregister(net, &ping_v6_seq_afinfo); |
1329 |
+ } |
1330 |
+diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c |
1331 |
+index 73a53c08091b..fa256f8038af 100644 |
1332 |
+--- a/net/sched/sch_hhf.c |
1333 |
++++ b/net/sched/sch_hhf.c |
1334 |
+@@ -528,7 +528,7 @@ static int hhf_change(struct Qdisc *sch, struct nlattr *opt) |
1335 |
+ new_hhf_non_hh_weight = nla_get_u32(tb[TCA_HHF_NON_HH_WEIGHT]); |
1336 |
+ |
1337 |
+ non_hh_quantum = (u64)new_quantum * new_hhf_non_hh_weight; |
1338 |
+- if (non_hh_quantum > INT_MAX) |
1339 |
++ if (non_hh_quantum == 0 || non_hh_quantum > INT_MAX) |
1340 |
+ return -EINVAL; |
1341 |
+ |
1342 |
+ sch_tree_lock(sch); |
1343 |
+diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c |
1344 |
+index a7529aca2ac8..6af871b1c297 100644 |
1345 |
+--- a/net/sctp/protocol.c |
1346 |
++++ b/net/sctp/protocol.c |
1347 |
+@@ -1344,7 +1344,7 @@ static int __net_init sctp_ctrlsock_init(struct net *net) |
1348 |
+ return status; |
1349 |
+ } |
1350 |
+ |
1351 |
+-static void __net_init sctp_ctrlsock_exit(struct net *net) |
1352 |
++static void __net_exit sctp_ctrlsock_exit(struct net *net) |
1353 |
+ { |
1354 |
+ /* Free the control endpoint. */ |
1355 |
+ inet_ctl_sock_destroy(net->sctp.ctl_sock); |
1356 |
+diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c |
1357 |
+index c3ae3e80a5a4..bf0c61adb09c 100644 |
1358 |
+--- a/net/sctp/sm_sideeffect.c |
1359 |
++++ b/net/sctp/sm_sideeffect.c |
1360 |
+@@ -542,7 +542,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_cmd_seq *commands, |
1361 |
+ if (net->sctp.pf_enable && |
1362 |
+ (transport->state == SCTP_ACTIVE) && |
1363 |
+ (transport->error_count < transport->pathmaxrxt) && |
1364 |
+- (transport->error_count > asoc->pf_retrans)) { |
1365 |
++ (transport->error_count > transport->pf_retrans)) { |
1366 |
+ |
1367 |
+ sctp_assoc_control_transport(asoc, transport, |
1368 |
+ SCTP_TRANSPORT_PF, |
1369 |
+diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c |
1370 |
+index 23f8899e0f8c..7ebcaff8c1c4 100644 |
1371 |
+--- a/net/tipc/name_distr.c |
1372 |
++++ b/net/tipc/name_distr.c |
1373 |
+@@ -224,7 +224,8 @@ static void tipc_publ_purge(struct net *net, struct publication *publ, u32 addr) |
1374 |
+ publ->key); |
1375 |
+ } |
1376 |
+ |
1377 |
+- kfree_rcu(p, rcu); |
1378 |
++ if (p) |
1379 |
++ kfree_rcu(p, rcu); |
1380 |
+ } |
1381 |
+ |
1382 |
+ /** |