Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Mon, 16 Sep 2019 12:23:05
Message-Id: 1568636568.c6f7629f1024ad9cb61d14f92590cd45acfecb2d.mpagano@gentoo
1 commit: c6f7629f1024ad9cb61d14f92590cd45acfecb2d
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 16 12:22:48 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 16 12:22:48 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=c6f7629f
7
8 Linux patch 4.14.144
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1143_linux-4.14.144.patch | 699 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 703 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 3e99608..af1af17 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -615,6 +615,10 @@ Patch: 1142_linux-4.14.143.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.143
23
24 +Patch: 1143_linux-4.14.144.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.144
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/1143_linux-4.14.144.patch b/1143_linux-4.14.144.patch
33 new file mode 100644
34 index 0000000..f7f4c4f
35 --- /dev/null
36 +++ b/1143_linux-4.14.144.patch
37 @@ -0,0 +1,699 @@
38 +diff --git a/Makefile b/Makefile
39 +index caa2fba089a5..4aa0dfec9b9b 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 = 143
47 ++SUBLEVEL = 144
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
52 +index e720f40bbd5d..3f8f528099a8 100644
53 +--- a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
54 ++++ b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
55 +@@ -77,6 +77,7 @@
56 + pinctrl-0 = <&usb30_host_drv>;
57 + regulator-name = "vcc_host_5v";
58 + regulator-always-on;
59 ++ regulator-boot-on;
60 + vin-supply = <&vcc_sys>;
61 + };
62 +
63 +@@ -87,6 +88,7 @@
64 + pinctrl-0 = <&usb20_host_drv>;
65 + regulator-name = "vcc_host1_5v";
66 + regulator-always-on;
67 ++ regulator-boot-on;
68 + vin-supply = <&vcc_sys>;
69 + };
70 +
71 +diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
72 +index 4f2e18266e34..8c04c51a6e14 100644
73 +--- a/arch/powerpc/kernel/head_64.S
74 ++++ b/arch/powerpc/kernel/head_64.S
75 +@@ -897,6 +897,7 @@ p_toc: .8byte __toc_start + 0x8000 - 0b
76 + /*
77 + * This is where the main kernel code starts.
78 + */
79 ++__REF
80 + start_here_multiplatform:
81 + /* set up the TOC */
82 + bl relative_toc
83 +@@ -972,6 +973,7 @@ start_here_multiplatform:
84 + RFI
85 + b . /* prevent speculative execution */
86 +
87 ++ .previous
88 + /* This is where all platforms converge execution */
89 +
90 + start_here_common:
91 +diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
92 +index b10531372d7f..5e5da2073fdf 100644
93 +--- a/arch/powerpc/kernel/process.c
94 ++++ b/arch/powerpc/kernel/process.c
95 +@@ -475,13 +475,14 @@ void giveup_all(struct task_struct *tsk)
96 + if (!tsk->thread.regs)
97 + return;
98 +
99 ++ check_if_tm_restore_required(tsk);
100 ++
101 + usermsr = tsk->thread.regs->msr;
102 +
103 + if ((usermsr & msr_all_available) == 0)
104 + return;
105 +
106 + msr_check_and_set(msr_all_available);
107 +- check_if_tm_restore_required(tsk);
108 +
109 + WARN_ON((usermsr & MSR_VSX) && !((usermsr & MSR_FP) && (usermsr & MSR_VEC)));
110 +
111 +diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
112 +index 14071a57c926..f5d74e8db432 100644
113 +--- a/drivers/clk/clk-s2mps11.c
114 ++++ b/drivers/clk/clk-s2mps11.c
115 +@@ -255,7 +255,7 @@ MODULE_DEVICE_TABLE(platform, s2mps11_clk_id);
116 + * This requires of_device_id table. In the same time this will not change the
117 + * actual *device* matching so do not add .of_match_table.
118 + */
119 +-static const struct of_device_id s2mps11_dt_match[] = {
120 ++static const struct of_device_id s2mps11_dt_match[] __used = {
121 + {
122 + .compatible = "samsung,s2mps11-clk",
123 + .data = (void *)S2MPS11X,
124 +diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
125 +index 50cc060cc552..4394c209cb2b 100644
126 +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
127 ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
128 +@@ -264,7 +264,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
129 +
130 + if ((HIGH_WORD(ebx) & MESSAGE_STATUS_SUCCESS) == 0) {
131 + kfree(reply);
132 +-
133 ++ reply = NULL;
134 + if ((HIGH_WORD(ebx) & MESSAGE_STATUS_CPT) != 0) {
135 + /* A checkpoint occurred. Retry. */
136 + continue;
137 +@@ -288,7 +288,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
138 +
139 + if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0) {
140 + kfree(reply);
141 +-
142 ++ reply = NULL;
143 + if ((HIGH_WORD(ecx) & MESSAGE_STATUS_CPT) != 0) {
144 + /* A checkpoint occurred. Retry. */
145 + continue;
146 +@@ -300,10 +300,8 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
147 + break;
148 + }
149 +
150 +- if (retries == RETRIES) {
151 +- kfree(reply);
152 ++ if (!reply)
153 + return -EINVAL;
154 +- }
155 +
156 + *msg_len = reply_len;
157 + *msg = reply;
158 +diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
159 +index 63052c5e5f82..7f5dfa169d0f 100644
160 +--- a/drivers/pci/dwc/pci-dra7xx.c
161 ++++ b/drivers/pci/dwc/pci-dra7xx.c
162 +@@ -227,6 +227,7 @@ static int dra7xx_pcie_intx_map(struct irq_domain *domain, unsigned int irq,
163 +
164 + static const struct irq_domain_ops intx_domain_ops = {
165 + .map = dra7xx_pcie_intx_map,
166 ++ .xlate = pci_irqd_intx_xlate,
167 + };
168 +
169 + static int dra7xx_pcie_init_irq_domain(struct pcie_port *pp)
170 +@@ -270,7 +271,7 @@ static irqreturn_t dra7xx_pcie_msi_irq_handler(int irq, void *arg)
171 + case INTC:
172 + case INTD:
173 + generic_handle_irq(irq_find_mapping(dra7xx->irq_domain,
174 +- ffs(reg)));
175 ++ ffs(reg) - 1));
176 + break;
177 + }
178 +
179 +diff --git a/drivers/pci/dwc/pcie-designware-ep.c b/drivers/pci/dwc/pcie-designware-ep.c
180 +index abcbf0770358..71795db41261 100644
181 +--- a/drivers/pci/dwc/pcie-designware-ep.c
182 ++++ b/drivers/pci/dwc/pcie-designware-ep.c
183 +@@ -74,8 +74,7 @@ static int dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, enum pci_barno bar,
184 + u32 free_win;
185 + struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
186 +
187 +- free_win = find_first_zero_bit(&ep->ib_window_map,
188 +- sizeof(ep->ib_window_map));
189 ++ free_win = find_first_zero_bit(ep->ib_window_map, ep->num_ib_windows);
190 + if (free_win >= ep->num_ib_windows) {
191 + dev_err(pci->dev, "no free inbound window\n");
192 + return -EINVAL;
193 +@@ -89,7 +88,7 @@ static int dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, enum pci_barno bar,
194 + }
195 +
196 + ep->bar_to_atu[bar] = free_win;
197 +- set_bit(free_win, &ep->ib_window_map);
198 ++ set_bit(free_win, ep->ib_window_map);
199 +
200 + return 0;
201 + }
202 +@@ -100,8 +99,7 @@ static int dw_pcie_ep_outbound_atu(struct dw_pcie_ep *ep, phys_addr_t phys_addr,
203 + u32 free_win;
204 + struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
205 +
206 +- free_win = find_first_zero_bit(&ep->ob_window_map,
207 +- sizeof(ep->ob_window_map));
208 ++ free_win = find_first_zero_bit(ep->ob_window_map, ep->num_ob_windows);
209 + if (free_win >= ep->num_ob_windows) {
210 + dev_err(pci->dev, "no free outbound window\n");
211 + return -EINVAL;
212 +@@ -110,7 +108,7 @@ static int dw_pcie_ep_outbound_atu(struct dw_pcie_ep *ep, phys_addr_t phys_addr,
213 + dw_pcie_prog_outbound_atu(pci, free_win, PCIE_ATU_TYPE_MEM,
214 + phys_addr, pci_addr, size);
215 +
216 +- set_bit(free_win, &ep->ob_window_map);
217 ++ set_bit(free_win, ep->ob_window_map);
218 + ep->outbound_addr[free_win] = phys_addr;
219 +
220 + return 0;
221 +@@ -125,7 +123,7 @@ static void dw_pcie_ep_clear_bar(struct pci_epc *epc, enum pci_barno bar)
222 + dw_pcie_ep_reset_bar(pci, bar);
223 +
224 + dw_pcie_disable_atu(pci, atu_index, DW_PCIE_REGION_INBOUND);
225 +- clear_bit(atu_index, &ep->ib_window_map);
226 ++ clear_bit(atu_index, ep->ib_window_map);
227 + }
228 +
229 + static int dw_pcie_ep_set_bar(struct pci_epc *epc, enum pci_barno bar,
230 +@@ -181,7 +179,7 @@ static void dw_pcie_ep_unmap_addr(struct pci_epc *epc, phys_addr_t addr)
231 + return;
232 +
233 + dw_pcie_disable_atu(pci, atu_index, DW_PCIE_REGION_OUTBOUND);
234 +- clear_bit(atu_index, &ep->ob_window_map);
235 ++ clear_bit(atu_index, ep->ob_window_map);
236 + }
237 +
238 + static int dw_pcie_ep_map_addr(struct pci_epc *epc, phys_addr_t addr,
239 +@@ -302,12 +300,32 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)
240 + dev_err(dev, "unable to read *num-ib-windows* property\n");
241 + return ret;
242 + }
243 ++ if (ep->num_ib_windows > MAX_IATU_IN) {
244 ++ dev_err(dev, "invalid *num-ib-windows*\n");
245 ++ return -EINVAL;
246 ++ }
247 +
248 + ret = of_property_read_u32(np, "num-ob-windows", &ep->num_ob_windows);
249 + if (ret < 0) {
250 + dev_err(dev, "unable to read *num-ob-windows* property\n");
251 + return ret;
252 + }
253 ++ if (ep->num_ob_windows > MAX_IATU_OUT) {
254 ++ dev_err(dev, "invalid *num-ob-windows*\n");
255 ++ return -EINVAL;
256 ++ }
257 ++
258 ++ ep->ib_window_map = devm_kzalloc(dev, sizeof(long) *
259 ++ BITS_TO_LONGS(ep->num_ib_windows),
260 ++ GFP_KERNEL);
261 ++ if (!ep->ib_window_map)
262 ++ return -ENOMEM;
263 ++
264 ++ ep->ob_window_map = devm_kzalloc(dev, sizeof(long) *
265 ++ BITS_TO_LONGS(ep->num_ob_windows),
266 ++ GFP_KERNEL);
267 ++ if (!ep->ob_window_map)
268 ++ return -ENOMEM;
269 +
270 + addr = devm_kzalloc(dev, sizeof(phys_addr_t) * ep->num_ob_windows,
271 + GFP_KERNEL);
272 +diff --git a/drivers/pci/dwc/pcie-designware.h b/drivers/pci/dwc/pcie-designware.h
273 +index 5af29d125c7e..ba9dedc31bfa 100644
274 +--- a/drivers/pci/dwc/pcie-designware.h
275 ++++ b/drivers/pci/dwc/pcie-designware.h
276 +@@ -114,6 +114,10 @@
277 + #define MAX_MSI_IRQS 32
278 + #define MAX_MSI_CTRLS (MAX_MSI_IRQS / 32)
279 +
280 ++/* Maximum number of inbound/outbound iATUs */
281 ++#define MAX_IATU_IN 256
282 ++#define MAX_IATU_OUT 256
283 ++
284 + struct pcie_port;
285 + struct dw_pcie;
286 + struct dw_pcie_ep;
287 +@@ -193,8 +197,8 @@ struct dw_pcie_ep {
288 + size_t page_size;
289 + u8 bar_to_atu[6];
290 + phys_addr_t *outbound_addr;
291 +- unsigned long ib_window_map;
292 +- unsigned long ob_window_map;
293 ++ unsigned long *ib_window_map;
294 ++ unsigned long *ob_window_map;
295 + u32 num_ib_windows;
296 + u32 num_ob_windows;
297 + };
298 +diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c
299 +index 3cc98c07dcd3..682fc58e1f75 100644
300 +--- a/drivers/vhost/test.c
301 ++++ b/drivers/vhost/test.c
302 +@@ -23,6 +23,12 @@
303 + * Using this limit prevents one virtqueue from starving others. */
304 + #define VHOST_TEST_WEIGHT 0x80000
305 +
306 ++/* Max number of packets transferred before requeueing the job.
307 ++ * Using this limit prevents one virtqueue from starving others with
308 ++ * pkts.
309 ++ */
310 ++#define VHOST_TEST_PKT_WEIGHT 256
311 ++
312 + enum {
313 + VHOST_TEST_VQ = 0,
314 + VHOST_TEST_VQ_MAX = 1,
315 +@@ -81,10 +87,8 @@ static void handle_vq(struct vhost_test *n)
316 + }
317 + vhost_add_used_and_signal(&n->dev, vq, head, 0);
318 + total_len += len;
319 +- if (unlikely(total_len >= VHOST_TEST_WEIGHT)) {
320 +- vhost_poll_queue(&vq->poll);
321 ++ if (unlikely(vhost_exceeds_weight(vq, 0, total_len)))
322 + break;
323 +- }
324 + }
325 +
326 + mutex_unlock(&vq->mutex);
327 +@@ -116,7 +120,8 @@ static int vhost_test_open(struct inode *inode, struct file *f)
328 + dev = &n->dev;
329 + vqs[VHOST_TEST_VQ] = &n->vqs[VHOST_TEST_VQ];
330 + n->vqs[VHOST_TEST_VQ].handle_kick = handle_vq_kick;
331 +- vhost_dev_init(dev, vqs, VHOST_TEST_VQ_MAX);
332 ++ vhost_dev_init(dev, vqs, VHOST_TEST_VQ_MAX,
333 ++ VHOST_TEST_PKT_WEIGHT, VHOST_TEST_WEIGHT);
334 +
335 + f->private_data = n;
336 +
337 +diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
338 +index 88fa81c482e8..3d7bea15c57b 100644
339 +--- a/drivers/vhost/vhost.c
340 ++++ b/drivers/vhost/vhost.c
341 +@@ -2066,7 +2066,7 @@ static int get_indirect(struct vhost_virtqueue *vq,
342 + /* If this is an input descriptor, increment that count. */
343 + if (access == VHOST_ACCESS_WO) {
344 + *in_num += ret;
345 +- if (unlikely(log)) {
346 ++ if (unlikely(log && ret)) {
347 + log[*log_num].addr = vhost64_to_cpu(vq, desc.addr);
348 + log[*log_num].len = vhost32_to_cpu(vq, desc.len);
349 + ++*log_num;
350 +@@ -2209,7 +2209,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq,
351 + /* If this is an input descriptor,
352 + * increment that count. */
353 + *in_num += ret;
354 +- if (unlikely(log)) {
355 ++ if (unlikely(log && ret)) {
356 + log[*log_num].addr = vhost64_to_cpu(vq, desc.addr);
357 + log[*log_num].len = vhost32_to_cpu(vq, desc.len);
358 + ++*log_num;
359 +diff --git a/include/net/ipv6_frag.h b/include/net/ipv6_frag.h
360 +index 28aa9b30aece..1f77fb4dc79d 100644
361 +--- a/include/net/ipv6_frag.h
362 ++++ b/include/net/ipv6_frag.h
363 +@@ -94,7 +94,6 @@ ip6frag_expire_frag_queue(struct net *net, struct frag_queue *fq)
364 + goto out;
365 +
366 + head->dev = dev;
367 +- skb_get(head);
368 + spin_unlock(&fq->q.lock);
369 +
370 + icmpv6_send(head, ICMPV6_TIME_EXCEED, ICMPV6_EXC_FRAGTIME, 0);
371 +diff --git a/include/net/xfrm.h b/include/net/xfrm.h
372 +index bdf185ae93db..57b8b11cf7d4 100644
373 +--- a/include/net/xfrm.h
374 ++++ b/include/net/xfrm.h
375 +@@ -1366,6 +1366,23 @@ static inline int xfrm_state_kern(const struct xfrm_state *x)
376 + return atomic_read(&x->tunnel_users);
377 + }
378 +
379 ++static inline bool xfrm_id_proto_valid(u8 proto)
380 ++{
381 ++ switch (proto) {
382 ++ case IPPROTO_AH:
383 ++ case IPPROTO_ESP:
384 ++ case IPPROTO_COMP:
385 ++#if IS_ENABLED(CONFIG_IPV6)
386 ++ case IPPROTO_ROUTING:
387 ++ case IPPROTO_DSTOPTS:
388 ++#endif
389 ++ return true;
390 ++ default:
391 ++ return false;
392 ++ }
393 ++}
394 ++
395 ++/* IPSEC_PROTO_ANY only matches 3 IPsec protocols, 0 could match all. */
396 + static inline int xfrm_id_proto_match(u8 proto, u8 userproto)
397 + {
398 + return (!userproto || proto == userproto ||
399 +diff --git a/kernel/module.c b/kernel/module.c
400 +index 4b372c14d9a1..468567591241 100644
401 +--- a/kernel/module.c
402 ++++ b/kernel/module.c
403 +@@ -1695,6 +1695,8 @@ static int add_usage_links(struct module *mod)
404 + return ret;
405 + }
406 +
407 ++static void module_remove_modinfo_attrs(struct module *mod, int end);
408 ++
409 + static int module_add_modinfo_attrs(struct module *mod)
410 + {
411 + struct module_attribute *attr;
412 +@@ -1709,24 +1711,34 @@ static int module_add_modinfo_attrs(struct module *mod)
413 + return -ENOMEM;
414 +
415 + temp_attr = mod->modinfo_attrs;
416 +- for (i = 0; (attr = modinfo_attrs[i]) && !error; i++) {
417 ++ for (i = 0; (attr = modinfo_attrs[i]); i++) {
418 + if (!attr->test || attr->test(mod)) {
419 + memcpy(temp_attr, attr, sizeof(*temp_attr));
420 + sysfs_attr_init(&temp_attr->attr);
421 + error = sysfs_create_file(&mod->mkobj.kobj,
422 + &temp_attr->attr);
423 ++ if (error)
424 ++ goto error_out;
425 + ++temp_attr;
426 + }
427 + }
428 ++
429 ++ return 0;
430 ++
431 ++error_out:
432 ++ if (i > 0)
433 ++ module_remove_modinfo_attrs(mod, --i);
434 + return error;
435 + }
436 +
437 +-static void module_remove_modinfo_attrs(struct module *mod)
438 ++static void module_remove_modinfo_attrs(struct module *mod, int end)
439 + {
440 + struct module_attribute *attr;
441 + int i;
442 +
443 + for (i = 0; (attr = &mod->modinfo_attrs[i]); i++) {
444 ++ if (end >= 0 && i > end)
445 ++ break;
446 + /* pick a field to test for end of list */
447 + if (!attr->attr.name)
448 + break;
449 +@@ -1814,7 +1826,7 @@ static int mod_sysfs_setup(struct module *mod,
450 + return 0;
451 +
452 + out_unreg_modinfo_attrs:
453 +- module_remove_modinfo_attrs(mod);
454 ++ module_remove_modinfo_attrs(mod, -1);
455 + out_unreg_param:
456 + module_param_sysfs_remove(mod);
457 + out_unreg_holders:
458 +@@ -1850,7 +1862,7 @@ static void mod_sysfs_fini(struct module *mod)
459 + {
460 + }
461 +
462 +-static void module_remove_modinfo_attrs(struct module *mod)
463 ++static void module_remove_modinfo_attrs(struct module *mod, int end)
464 + {
465 + }
466 +
467 +@@ -1866,7 +1878,7 @@ static void init_param_lock(struct module *mod)
468 + static void mod_sysfs_teardown(struct module *mod)
469 + {
470 + del_usage_links(mod);
471 +- module_remove_modinfo_attrs(mod);
472 ++ module_remove_modinfo_attrs(mod, -1);
473 + module_param_sysfs_remove(mod);
474 + kobject_put(mod->mkobj.drivers_dir);
475 + kobject_put(mod->holders_dir);
476 +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
477 +index 0a4e882d4308..c298d47888ed 100644
478 +--- a/kernel/sched/fair.c
479 ++++ b/kernel/sched/fair.c
480 +@@ -4206,6 +4206,8 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec)
481 + if (likely(cfs_rq->runtime_remaining > 0))
482 + return;
483 +
484 ++ if (cfs_rq->throttled)
485 ++ return;
486 + /*
487 + * if we're unable to extend our runtime we resched so that the active
488 + * hierarchy can be throttled
489 +@@ -4402,6 +4404,9 @@ static u64 distribute_cfs_runtime(struct cfs_bandwidth *cfs_b,
490 + if (!cfs_rq_throttled(cfs_rq))
491 + goto next;
492 +
493 ++ /* By the above check, this should never be true */
494 ++ SCHED_WARN_ON(cfs_rq->runtime_remaining > 0);
495 ++
496 + runtime = -cfs_rq->runtime_remaining + 1;
497 + if (runtime > remaining)
498 + runtime = remaining;
499 +diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
500 +index 5bd9b389f8c9..8b3f9441b3a0 100644
501 +--- a/net/batman-adv/bat_iv_ogm.c
502 ++++ b/net/batman-adv/bat_iv_ogm.c
503 +@@ -450,17 +450,23 @@ static u8 batadv_hop_penalty(u8 tq, const struct batadv_priv *bat_priv)
504 + * batadv_iv_ogm_aggr_packet - checks if there is another OGM attached
505 + * @buff_pos: current position in the skb
506 + * @packet_len: total length of the skb
507 +- * @tvlv_len: tvlv length of the previously considered OGM
508 ++ * @ogm_packet: potential OGM in buffer
509 + *
510 + * Return: true if there is enough space for another OGM, false otherwise.
511 + */
512 +-static bool batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len,
513 +- __be16 tvlv_len)
514 ++static bool
515 ++batadv_iv_ogm_aggr_packet(int buff_pos, int packet_len,
516 ++ const struct batadv_ogm_packet *ogm_packet)
517 + {
518 + int next_buff_pos = 0;
519 +
520 +- next_buff_pos += buff_pos + BATADV_OGM_HLEN;
521 +- next_buff_pos += ntohs(tvlv_len);
522 ++ /* check if there is enough space for the header */
523 ++ next_buff_pos += buff_pos + sizeof(*ogm_packet);
524 ++ if (next_buff_pos > packet_len)
525 ++ return false;
526 ++
527 ++ /* check if there is enough space for the optional TVLV */
528 ++ next_buff_pos += ntohs(ogm_packet->tvlv_len);
529 +
530 + return (next_buff_pos <= packet_len) &&
531 + (next_buff_pos <= BATADV_MAX_AGGREGATION_BYTES);
532 +@@ -488,7 +494,7 @@ static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet,
533 +
534 + /* adjust all flags and log packets */
535 + while (batadv_iv_ogm_aggr_packet(buff_pos, forw_packet->packet_len,
536 +- batadv_ogm_packet->tvlv_len)) {
537 ++ batadv_ogm_packet)) {
538 + /* we might have aggregated direct link packets with an
539 + * ordinary base packet
540 + */
541 +@@ -1838,7 +1844,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
542 +
543 + /* unpack the aggregated packets and process them one by one */
544 + while (batadv_iv_ogm_aggr_packet(ogm_offset, skb_headlen(skb),
545 +- ogm_packet->tvlv_len)) {
546 ++ ogm_packet)) {
547 + batadv_iv_ogm_process(skb, ogm_offset, if_incoming);
548 +
549 + ogm_offset += BATADV_OGM_HLEN;
550 +diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
551 +index ab13b4d58733..edb35bcc046d 100644
552 +--- a/net/batman-adv/netlink.c
553 ++++ b/net/batman-adv/netlink.c
554 +@@ -110,7 +110,7 @@ batadv_netlink_get_ifindex(const struct nlmsghdr *nlh, int attrtype)
555 + {
556 + struct nlattr *attr = nlmsg_find_attr(nlh, GENL_HDRLEN, attrtype);
557 +
558 +- return attr ? nla_get_u32(attr) : 0;
559 ++ return (attr && nla_len(attr) == sizeof(u32)) ? nla_get_u32(attr) : 0;
560 + }
561 +
562 + /**
563 +diff --git a/net/key/af_key.c b/net/key/af_key.c
564 +index ac38b47e9f86..f8f7065f7b62 100644
565 +--- a/net/key/af_key.c
566 ++++ b/net/key/af_key.c
567 +@@ -1951,8 +1951,10 @@ parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq)
568 +
569 + if (rq->sadb_x_ipsecrequest_mode == 0)
570 + return -EINVAL;
571 ++ if (!xfrm_id_proto_valid(rq->sadb_x_ipsecrequest_proto))
572 ++ return -EINVAL;
573 +
574 +- t->id.proto = rq->sadb_x_ipsecrequest_proto; /* XXX check proto */
575 ++ t->id.proto = rq->sadb_x_ipsecrequest_proto;
576 + if ((mode = pfkey_mode_to_xfrm(rq->sadb_x_ipsecrequest_mode)) < 0)
577 + return -EINVAL;
578 + t->mode = mode;
579 +diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
580 +index 52ac3e49c7ef..ec72a5edaa1b 100644
581 +--- a/net/vmw_vsock/hyperv_transport.c
582 ++++ b/net/vmw_vsock/hyperv_transport.c
583 +@@ -320,6 +320,11 @@ static void hvs_close_connection(struct vmbus_channel *chan)
584 + lock_sock(sk);
585 + hvs_do_close_lock_held(vsock_sk(sk), true);
586 + release_sock(sk);
587 ++
588 ++ /* Release the refcnt for the channel that's opened in
589 ++ * hvs_open_connection().
590 ++ */
591 ++ sock_put(sk);
592 + }
593 +
594 + static void hvs_open_connection(struct vmbus_channel *chan)
595 +@@ -389,6 +394,9 @@ static void hvs_open_connection(struct vmbus_channel *chan)
596 + }
597 +
598 + set_per_channel_state(chan, conn_from_host ? new : sk);
599 ++
600 ++ /* This reference will be dropped by hvs_close_connection(). */
601 ++ sock_hold(conn_from_host ? new : sk);
602 + vmbus_set_chn_rescind_callback(chan, hvs_close_connection);
603 +
604 + /* Set the pending send size to max packet size to always get
605 +diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
606 +index 7c093de68780..bd16e6882017 100644
607 +--- a/net/xfrm/xfrm_state.c
608 ++++ b/net/xfrm/xfrm_state.c
609 +@@ -2330,7 +2330,7 @@ void xfrm_state_fini(struct net *net)
610 + unsigned int sz;
611 +
612 + flush_work(&net->xfrm.state_hash_work);
613 +- xfrm_state_flush(net, IPSEC_PROTO_ANY, false);
614 ++ xfrm_state_flush(net, 0, false);
615 + flush_work(&xfrm_state_gc_work);
616 +
617 + WARN_ON(!list_empty(&net->xfrm.state_all));
618 +diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
619 +index 150c58dc8a7b..339a070da597 100644
620 +--- a/net/xfrm/xfrm_user.c
621 ++++ b/net/xfrm/xfrm_user.c
622 +@@ -1489,20 +1489,8 @@ static int validate_tmpl(int nr, struct xfrm_user_tmpl *ut, u16 family)
623 + return -EINVAL;
624 + }
625 +
626 +- switch (ut[i].id.proto) {
627 +- case IPPROTO_AH:
628 +- case IPPROTO_ESP:
629 +- case IPPROTO_COMP:
630 +-#if IS_ENABLED(CONFIG_IPV6)
631 +- case IPPROTO_ROUTING:
632 +- case IPPROTO_DSTOPTS:
633 +-#endif
634 +- case IPSEC_PROTO_ANY:
635 +- break;
636 +- default:
637 ++ if (!xfrm_id_proto_valid(ut[i].id.proto))
638 + return -EINVAL;
639 +- }
640 +-
641 + }
642 +
643 + return 0;
644 +diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh
645 +index c4a9ddb174bc..5aa75a0a1ced 100755
646 +--- a/scripts/decode_stacktrace.sh
647 ++++ b/scripts/decode_stacktrace.sh
648 +@@ -78,7 +78,7 @@ parse_symbol() {
649 + fi
650 +
651 + # Strip out the base of the path
652 +- code=${code//^$basepath/""}
653 ++ code=${code#$basepath/}
654 +
655 + # In the case of inlines, move everything to same line
656 + code=${code//$'\n'/' '}
657 +diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
658 +index d3ea73171a3d..8b1cf237b96e 100644
659 +--- a/sound/pci/hda/hda_auto_parser.c
660 ++++ b/sound/pci/hda/hda_auto_parser.c
661 +@@ -828,6 +828,8 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
662 + while (id >= 0) {
663 + const struct hda_fixup *fix = codec->fixup_list + id;
664 +
665 ++ if (++depth > 10)
666 ++ break;
667 + if (fix->chained_before)
668 + apply_fixup(codec, fix->chain_id, action, depth + 1);
669 +
670 +@@ -867,8 +869,6 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
671 + }
672 + if (!fix->chained || fix->chained_before)
673 + break;
674 +- if (++depth > 10)
675 +- break;
676 + id = fix->chain_id;
677 + }
678 + }
679 +diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
680 +index ec9dda536d89..28ef409a9e6a 100644
681 +--- a/sound/pci/hda/hda_generic.c
682 ++++ b/sound/pci/hda/hda_generic.c
683 +@@ -5854,7 +5854,8 @@ int snd_hda_gen_init(struct hda_codec *codec)
684 + if (spec->init_hook)
685 + spec->init_hook(codec);
686 +
687 +- snd_hda_apply_verbs(codec);
688 ++ if (!spec->skip_verbs)
689 ++ snd_hda_apply_verbs(codec);
690 +
691 + init_multi_out(codec);
692 + init_extra_out(codec);
693 +diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
694 +index d82c09db0276..17a6bff8e94e 100644
695 +--- a/sound/pci/hda/hda_generic.h
696 ++++ b/sound/pci/hda/hda_generic.h
697 +@@ -237,6 +237,7 @@ struct hda_gen_spec {
698 + unsigned int indep_hp_enabled:1; /* independent HP enabled */
699 + unsigned int have_aamix_ctl:1;
700 + unsigned int hp_mic_jack_modes:1;
701 ++ unsigned int skip_verbs:1; /* don't apply verbs at snd_hda_gen_init() */
702 +
703 + /* additional mute flags (only effective with auto_mute_via_amp=1) */
704 + u64 mute_bits;
705 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
706 +index 32115e0b26c9..6deb96a301d3 100644
707 +--- a/sound/pci/hda/patch_realtek.c
708 ++++ b/sound/pci/hda/patch_realtek.c
709 +@@ -781,9 +781,11 @@ static int alc_init(struct hda_codec *codec)
710 + if (spec->init_hook)
711 + spec->init_hook(codec);
712 +
713 ++ spec->gen.skip_verbs = 1; /* applied in below */
714 + snd_hda_gen_init(codec);
715 + alc_fix_pll(codec);
716 + alc_auto_init_amp(codec, spec->init_amp);
717 ++ snd_hda_apply_verbs(codec); /* apply verbs here after own init */
718 +
719 + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
720 +
721 +@@ -6586,6 +6588,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
722 + SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
723 + SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
724 + SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
725 ++ SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
726 + SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
727 + SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
728 + SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
729 +@@ -8287,6 +8290,7 @@ static int patch_alc680(struct hda_codec *codec)
730 + static const struct hda_device_id snd_hda_id_realtek[] = {
731 + HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
732 + HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
733 ++ HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
734 + HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
735 + HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
736 + HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),