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: Tue, 11 Jan 2022 13:16:31
Message-Id: 1641906971.8e8977bc895c9d33a0c2fe51c7f50dc907b0f449.mpagano@gentoo
1 commit: 8e8977bc895c9d33a0c2fe51c7f50dc907b0f449
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 11 13:16:11 2022 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 11 13:16:11 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=8e8977bc
7
8 Linux patch 4.14.262
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1261_linux-4.14.262.patch | 577 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 581 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index cb71c828..2d45cc2a 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1091,6 +1091,10 @@ Patch: 1260_linux-4.14.261.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.261
23
24 +Patch: 1261_linux-4.14.262.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.262
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/1261_linux-4.14.262.patch b/1261_linux-4.14.262.patch
33 new file mode 100644
34 index 00000000..26d88cd7
35 --- /dev/null
36 +++ b/1261_linux-4.14.262.patch
37 @@ -0,0 +1,577 @@
38 +diff --git a/Makefile b/Makefile
39 +index 38e64d636717b..33ffaa163c2bc 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 = 261
47 ++SUBLEVEL = 262
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
52 +index f2e84e09c970f..40db5c400519d 100644
53 +--- a/drivers/bluetooth/btusb.c
54 ++++ b/drivers/bluetooth/btusb.c
55 +@@ -2548,11 +2548,9 @@ static const struct qca_device_info qca_devices_table[] = {
56 + { 0x00000302, 28, 4, 18 }, /* Rome 3.2 */
57 + };
58 +
59 +-static int btusb_qca_send_vendor_req(struct hci_dev *hdev, u8 request,
60 ++static int btusb_qca_send_vendor_req(struct usb_device *udev, u8 request,
61 + void *data, u16 size)
62 + {
63 +- struct btusb_data *btdata = hci_get_drvdata(hdev);
64 +- struct usb_device *udev = btdata->udev;
65 + int pipe, err;
66 + u8 *buf;
67 +
68 +@@ -2567,7 +2565,7 @@ static int btusb_qca_send_vendor_req(struct hci_dev *hdev, u8 request,
69 + err = usb_control_msg(udev, pipe, request, USB_TYPE_VENDOR | USB_DIR_IN,
70 + 0, 0, buf, size, USB_CTRL_SET_TIMEOUT);
71 + if (err < 0) {
72 +- BT_ERR("%s: Failed to access otp area (%d)", hdev->name, err);
73 ++ dev_err(&udev->dev, "Failed to access otp area (%d)", err);
74 + goto done;
75 + }
76 +
77 +@@ -2723,20 +2721,38 @@ static int btusb_setup_qca_load_nvm(struct hci_dev *hdev,
78 + return err;
79 + }
80 +
81 ++/* identify the ROM version and check whether patches are needed */
82 ++static bool btusb_qca_need_patch(struct usb_device *udev)
83 ++{
84 ++ struct qca_version ver;
85 ++
86 ++ if (btusb_qca_send_vendor_req(udev, QCA_GET_TARGET_VERSION, &ver,
87 ++ sizeof(ver)) < 0)
88 ++ return false;
89 ++ /* only low ROM versions need patches */
90 ++ return !(le32_to_cpu(ver.rom_version) & ~0xffffU);
91 ++}
92 ++
93 + static int btusb_setup_qca(struct hci_dev *hdev)
94 + {
95 ++ struct btusb_data *btdata = hci_get_drvdata(hdev);
96 ++ struct usb_device *udev = btdata->udev;
97 + const struct qca_device_info *info = NULL;
98 + struct qca_version ver;
99 + u32 ver_rom;
100 + u8 status;
101 + int i, err;
102 +
103 +- err = btusb_qca_send_vendor_req(hdev, QCA_GET_TARGET_VERSION, &ver,
104 ++ err = btusb_qca_send_vendor_req(udev, QCA_GET_TARGET_VERSION, &ver,
105 + sizeof(ver));
106 + if (err < 0)
107 + return err;
108 +
109 + ver_rom = le32_to_cpu(ver.rom_version);
110 ++ /* Don't care about high ROM versions */
111 ++ if (ver_rom & ~0xffffU)
112 ++ return 0;
113 ++
114 + for (i = 0; i < ARRAY_SIZE(qca_devices_table); i++) {
115 + if (ver_rom == qca_devices_table[i].rom_version)
116 + info = &qca_devices_table[i];
117 +@@ -2747,7 +2763,7 @@ static int btusb_setup_qca(struct hci_dev *hdev)
118 + return -ENODEV;
119 + }
120 +
121 +- err = btusb_qca_send_vendor_req(hdev, QCA_CHECK_STATUS, &status,
122 ++ err = btusb_qca_send_vendor_req(udev, QCA_CHECK_STATUS, &status,
123 + sizeof(status));
124 + if (err < 0)
125 + return err;
126 +@@ -2974,7 +2990,8 @@ static int btusb_probe(struct usb_interface *intf,
127 + /* Old firmware would otherwise let ath3k driver load
128 + * patch and sysconfig files
129 + */
130 +- if (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x0001)
131 ++ if (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x0001 &&
132 ++ !btusb_qca_need_patch(udev))
133 + return -ENODEV;
134 + }
135 +
136 +@@ -3136,6 +3153,7 @@ static int btusb_probe(struct usb_interface *intf,
137 + }
138 +
139 + if (id->driver_info & BTUSB_ATH3012) {
140 ++ data->setup_on_usb = btusb_setup_qca;
141 + hdev->set_bdaddr = btusb_set_bdaddr_ath3012;
142 + set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
143 + set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
144 +diff --git a/drivers/infiniband/core/uverbs_marshall.c b/drivers/infiniband/core/uverbs_marshall.c
145 +index bd0acf376af0f..9eb1cff57353e 100644
146 +--- a/drivers/infiniband/core/uverbs_marshall.c
147 ++++ b/drivers/infiniband/core/uverbs_marshall.c
148 +@@ -66,7 +66,7 @@ void ib_copy_ah_attr_to_user(struct ib_device *device,
149 + struct rdma_ah_attr *src = ah_attr;
150 + struct rdma_ah_attr conv_ah;
151 +
152 +- memset(&dst->grh.reserved, 0, sizeof(dst->grh.reserved));
153 ++ memset(&dst->grh, 0, sizeof(dst->grh));
154 +
155 + if ((ah_attr->type == RDMA_AH_ATTR_TYPE_OPA) &&
156 + (rdma_ah_get_dlid(ah_attr) >=
157 +diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c
158 +index faf505462a4f5..f5a06a6fb297f 100644
159 +--- a/drivers/isdn/mISDN/core.c
160 ++++ b/drivers/isdn/mISDN/core.c
161 +@@ -390,7 +390,7 @@ mISDNInit(void)
162 + err = mISDN_inittimer(&debug);
163 + if (err)
164 + goto error2;
165 +- err = l1_init(&debug);
166 ++ err = Isdnl1_Init(&debug);
167 + if (err)
168 + goto error3;
169 + err = Isdnl2_Init(&debug);
170 +@@ -404,7 +404,7 @@ mISDNInit(void)
171 + error5:
172 + Isdnl2_cleanup();
173 + error4:
174 +- l1_cleanup();
175 ++ Isdnl1_cleanup();
176 + error3:
177 + mISDN_timer_cleanup();
178 + error2:
179 +@@ -417,7 +417,7 @@ static void mISDN_cleanup(void)
180 + {
181 + misdn_sock_cleanup();
182 + Isdnl2_cleanup();
183 +- l1_cleanup();
184 ++ Isdnl1_cleanup();
185 + mISDN_timer_cleanup();
186 + class_unregister(&mISDN_class);
187 +
188 +diff --git a/drivers/isdn/mISDN/core.h b/drivers/isdn/mISDN/core.h
189 +index 52695bb81ee7a..3c039b6ade2e1 100644
190 +--- a/drivers/isdn/mISDN/core.h
191 ++++ b/drivers/isdn/mISDN/core.h
192 +@@ -69,8 +69,8 @@ struct Bprotocol *get_Bprotocol4id(u_int);
193 + extern int mISDN_inittimer(u_int *);
194 + extern void mISDN_timer_cleanup(void);
195 +
196 +-extern int l1_init(u_int *);
197 +-extern void l1_cleanup(void);
198 ++extern int Isdnl1_Init(u_int *);
199 ++extern void Isdnl1_cleanup(void);
200 + extern int Isdnl2_Init(u_int *);
201 + extern void Isdnl2_cleanup(void);
202 +
203 +diff --git a/drivers/isdn/mISDN/layer1.c b/drivers/isdn/mISDN/layer1.c
204 +index 3192b0eb39445..284d3a9c7df7d 100644
205 +--- a/drivers/isdn/mISDN/layer1.c
206 ++++ b/drivers/isdn/mISDN/layer1.c
207 +@@ -407,7 +407,7 @@ create_l1(struct dchannel *dch, dchannel_l1callback *dcb) {
208 + EXPORT_SYMBOL(create_l1);
209 +
210 + int
211 +-l1_init(u_int *deb)
212 ++Isdnl1_Init(u_int *deb)
213 + {
214 + debug = deb;
215 + l1fsm_s.state_count = L1S_STATE_COUNT;
216 +@@ -418,7 +418,7 @@ l1_init(u_int *deb)
217 + }
218 +
219 + void
220 +-l1_cleanup(void)
221 ++Isdnl1_cleanup(void)
222 + {
223 + mISDN_FsmFree(&l1fsm_s);
224 + }
225 +diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
226 +index 44a9c8aa3067a..5b5434976698e 100644
227 +--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
228 ++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
229 +@@ -114,6 +114,24 @@ MODULE_VERSION(DRV_VERSION);
230 +
231 + static struct workqueue_struct *i40e_wq;
232 +
233 ++static void netdev_hw_addr_refcnt(struct i40e_mac_filter *f,
234 ++ struct net_device *netdev, int delta)
235 ++{
236 ++ struct netdev_hw_addr *ha;
237 ++
238 ++ if (!f || !netdev)
239 ++ return;
240 ++
241 ++ netdev_for_each_mc_addr(ha, netdev) {
242 ++ if (ether_addr_equal(ha->addr, f->macaddr)) {
243 ++ ha->refcount += delta;
244 ++ if (ha->refcount <= 0)
245 ++ ha->refcount = 1;
246 ++ break;
247 ++ }
248 ++ }
249 ++}
250 ++
251 + /**
252 + * i40e_allocate_dma_mem_d - OS specific memory alloc for shared code
253 + * @hw: pointer to the HW structure
254 +@@ -1827,6 +1845,7 @@ static void i40e_undo_add_filter_entries(struct i40e_vsi *vsi,
255 + hlist_for_each_entry_safe(new, h, from, hlist) {
256 + /* We can simply free the wrapper structure */
257 + hlist_del(&new->hlist);
258 ++ netdev_hw_addr_refcnt(new->f, vsi->netdev, -1);
259 + kfree(new);
260 + }
261 + }
262 +@@ -2093,6 +2112,10 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
263 + &tmp_add_list,
264 + &tmp_del_list,
265 + vlan_filters);
266 ++
267 ++ hlist_for_each_entry(new, &tmp_add_list, hlist)
268 ++ netdev_hw_addr_refcnt(new->f, vsi->netdev, 1);
269 ++
270 + if (retval)
271 + goto err_no_memory_locked;
272 +
273 +@@ -2232,6 +2255,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
274 + if (new->f->state == I40E_FILTER_NEW)
275 + new->f->state = new->state;
276 + hlist_del(&new->hlist);
277 ++ netdev_hw_addr_refcnt(new->f, vsi->netdev, -1);
278 + kfree(new);
279 + }
280 + spin_unlock_bh(&vsi->mac_filter_hash_lock);
281 +@@ -5705,6 +5729,27 @@ int i40e_open(struct net_device *netdev)
282 + return 0;
283 + }
284 +
285 ++/**
286 ++ * i40e_netif_set_realnum_tx_rx_queues - Update number of tx/rx queues
287 ++ * @vsi: vsi structure
288 ++ *
289 ++ * This updates netdev's number of tx/rx queues
290 ++ *
291 ++ * Returns status of setting tx/rx queues
292 ++ **/
293 ++static int i40e_netif_set_realnum_tx_rx_queues(struct i40e_vsi *vsi)
294 ++{
295 ++ int ret;
296 ++
297 ++ ret = netif_set_real_num_rx_queues(vsi->netdev,
298 ++ vsi->num_queue_pairs);
299 ++ if (ret)
300 ++ return ret;
301 ++
302 ++ return netif_set_real_num_tx_queues(vsi->netdev,
303 ++ vsi->num_queue_pairs);
304 ++}
305 ++
306 + /**
307 + * i40e_vsi_open -
308 + * @vsi: the VSI to open
309 +@@ -5741,13 +5786,7 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
310 + goto err_setup_rx;
311 +
312 + /* Notify the stack of the actual queue counts. */
313 +- err = netif_set_real_num_tx_queues(vsi->netdev,
314 +- vsi->num_queue_pairs);
315 +- if (err)
316 +- goto err_set_queues;
317 +-
318 +- err = netif_set_real_num_rx_queues(vsi->netdev,
319 +- vsi->num_queue_pairs);
320 ++ err = i40e_netif_set_realnum_tx_rx_queues(vsi);
321 + if (err)
322 + goto err_set_queues;
323 +
324 +@@ -10429,6 +10468,9 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
325 + case I40E_VSI_MAIN:
326 + case I40E_VSI_VMDQ2:
327 + ret = i40e_config_netdev(vsi);
328 ++ if (ret)
329 ++ goto err_netdev;
330 ++ ret = i40e_netif_set_realnum_tx_rx_queues(vsi);
331 + if (ret)
332 + goto err_netdev;
333 + ret = register_netdev(vsi->netdev);
334 +diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
335 +index 2c4274453c156..95510638ebd77 100644
336 +--- a/drivers/net/ieee802154/atusb.c
337 ++++ b/drivers/net/ieee802154/atusb.c
338 +@@ -84,7 +84,9 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,
339 +
340 + ret = usb_control_msg(usb_dev, pipe, request, requesttype,
341 + value, index, data, size, timeout);
342 +- if (ret < 0) {
343 ++ if (ret < size) {
344 ++ ret = ret < 0 ? ret : -ENODATA;
345 ++
346 + atusb->err = ret;
347 + dev_err(&usb_dev->dev,
348 + "atusb_control_msg: req 0x%02x val 0x%x idx 0x%x, error %d\n",
349 +@@ -656,9 +658,9 @@ static int atusb_get_and_show_build(struct atusb *atusb)
350 + if (!build)
351 + return -ENOMEM;
352 +
353 +- ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
354 +- ATUSB_BUILD, ATUSB_REQ_FROM_DEV, 0, 0,
355 +- build, ATUSB_BUILD_SIZE, 1000);
356 ++ /* We cannot call atusb_control_msg() here, since this request may read various length data */
357 ++ ret = usb_control_msg(atusb->usb_dev, usb_rcvctrlpipe(usb_dev, 0), ATUSB_BUILD,
358 ++ ATUSB_REQ_FROM_DEV, 0, 0, build, ATUSB_BUILD_SIZE, 1000);
359 + if (ret >= 0) {
360 + build[ret] = 0;
361 + dev_info(&usb_dev->dev, "Firmware: build %s\n", build);
362 +diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
363 +index d3f79a4067e22..ab41a63aa4aaa 100644
364 +--- a/drivers/net/usb/rndis_host.c
365 ++++ b/drivers/net/usb/rndis_host.c
366 +@@ -620,6 +620,11 @@ static const struct usb_device_id products [] = {
367 + USB_DEVICE_AND_INTERFACE_INFO(0x1630, 0x0042,
368 + USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
369 + .driver_info = (unsigned long) &rndis_poll_status_info,
370 ++}, {
371 ++ /* Hytera Communications DMR radios' "Radio to PC Network" */
372 ++ USB_VENDOR_AND_INTERFACE_INFO(0x238b,
373 ++ USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
374 ++ .driver_info = (unsigned long)&rndis_info,
375 + }, {
376 + /* RNDIS is MSFT's un-official variant of CDC ACM */
377 + USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
378 +diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c
379 +index bfcd6fba6363b..d93b430ca38b9 100644
380 +--- a/drivers/power/reset/ltc2952-poweroff.c
381 ++++ b/drivers/power/reset/ltc2952-poweroff.c
382 +@@ -169,8 +169,8 @@ static void ltc2952_poweroff_kill(void)
383 +
384 + static void ltc2952_poweroff_default(struct ltc2952_poweroff *data)
385 + {
386 +- data->wde_interval = 300L * 1E6L;
387 +- data->trigger_delay = ktime_set(2, 500L*1E6L);
388 ++ data->wde_interval = 300L * NSEC_PER_MSEC;
389 ++ data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC);
390 +
391 + hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
392 + data->timer_trigger.function = ltc2952_poweroff_timer_trigger;
393 +diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
394 +index f3dfec02abecc..ebf3a277d8bba 100644
395 +--- a/drivers/scsi/libiscsi.c
396 ++++ b/drivers/scsi/libiscsi.c
397 +@@ -2991,6 +2991,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
398 + {
399 + struct iscsi_conn *conn = cls_conn->dd_data;
400 + struct iscsi_session *session = conn->session;
401 ++ char *tmp_persistent_address = conn->persistent_address;
402 ++ char *tmp_local_ipaddr = conn->local_ipaddr;
403 +
404 + del_timer_sync(&conn->transport_timer);
405 +
406 +@@ -3012,8 +3014,6 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
407 + spin_lock_bh(&session->frwd_lock);
408 + free_pages((unsigned long) conn->data,
409 + get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
410 +- kfree(conn->persistent_address);
411 +- kfree(conn->local_ipaddr);
412 + /* regular RX path uses back_lock */
413 + spin_lock_bh(&session->back_lock);
414 + kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task,
415 +@@ -3025,6 +3025,8 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
416 + mutex_unlock(&session->eh_mutex);
417 +
418 + iscsi_destroy_conn(cls_conn);
419 ++ kfree(tmp_persistent_address);
420 ++ kfree(tmp_local_ipaddr);
421 + }
422 + EXPORT_SYMBOL_GPL(iscsi_conn_teardown);
423 +
424 +diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
425 +index 80a3704939cdc..b9c06885de6a1 100644
426 +--- a/drivers/virtio/virtio_pci_common.c
427 ++++ b/drivers/virtio/virtio_pci_common.c
428 +@@ -575,6 +575,13 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)
429 + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
430 + struct device *dev = get_device(&vp_dev->vdev.dev);
431 +
432 ++ /*
433 ++ * Device is marked broken on surprise removal so that virtio upper
434 ++ * layers can abort any ongoing operation.
435 ++ */
436 ++ if (!pci_device_is_present(pci_dev))
437 ++ virtio_break_device(&vp_dev->vdev);
438 ++
439 + unregister_virtio_device(&vp_dev->vdev);
440 +
441 + if (vp_dev->ioaddr)
442 +diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
443 +index 79a9a0def7dbd..5b2b223f92858 100644
444 +--- a/fs/xfs/xfs_ioctl.c
445 ++++ b/fs/xfs/xfs_ioctl.c
446 +@@ -715,7 +715,8 @@ xfs_ioc_space(
447 + flags |= XFS_PREALLOC_CLEAR;
448 + if (bf->l_start > XFS_ISIZE(ip)) {
449 + error = xfs_alloc_file_space(ip, XFS_ISIZE(ip),
450 +- bf->l_start - XFS_ISIZE(ip), 0);
451 ++ bf->l_start - XFS_ISIZE(ip),
452 ++ XFS_BMAPI_PREALLOC);
453 + if (error)
454 + goto out_unlock;
455 + }
456 +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
457 +index cb4f6f9e27059..fd8e1ec39c270 100644
458 +--- a/kernel/trace/trace.c
459 ++++ b/kernel/trace/trace.c
460 +@@ -2810,7 +2810,7 @@ struct trace_buffer_struct {
461 + char buffer[4][TRACE_BUF_SIZE];
462 + };
463 +
464 +-static struct trace_buffer_struct *trace_percpu_buffer;
465 ++static struct trace_buffer_struct __percpu *trace_percpu_buffer;
466 +
467 + /*
468 + * Thise allows for lockless recording. If we're nested too deeply, then
469 +@@ -2820,7 +2820,7 @@ static char *get_trace_buf(void)
470 + {
471 + struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer);
472 +
473 +- if (!buffer || buffer->nesting >= 4)
474 ++ if (!trace_percpu_buffer || buffer->nesting >= 4)
475 + return NULL;
476 +
477 + buffer->nesting++;
478 +@@ -2839,7 +2839,7 @@ static void put_trace_buf(void)
479 +
480 + static int alloc_percpu_trace_buffer(void)
481 + {
482 +- struct trace_buffer_struct *buffers;
483 ++ struct trace_buffer_struct __percpu *buffers;
484 +
485 + buffers = alloc_percpu(struct trace_buffer_struct);
486 + if (WARN(!buffers, "Could not allocate percpu trace_printk buffer"))
487 +diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
488 +index 4faeb698c33c9..fee1cdcc224e6 100644
489 +--- a/net/ipv4/udp.c
490 ++++ b/net/ipv4/udp.c
491 +@@ -2777,7 +2777,7 @@ int udp4_seq_show(struct seq_file *seq, void *v)
492 + {
493 + seq_setwidth(seq, 127);
494 + if (v == SEQ_START_TOKEN)
495 +- seq_puts(seq, " sl local_address rem_address st tx_queue "
496 ++ seq_puts(seq, " sl local_address rem_address st tx_queue "
497 + "rx_queue tr tm->when retrnsmt uid timeout "
498 + "inode ref pointer drops");
499 + else {
500 +diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
501 +index 299226b57ba50..a4ba470186482 100644
502 +--- a/net/ipv6/ip6_vti.c
503 ++++ b/net/ipv6/ip6_vti.c
504 +@@ -775,6 +775,8 @@ vti6_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
505 + struct net *net = dev_net(dev);
506 + struct vti6_net *ip6n = net_generic(net, vti6_net_id);
507 +
508 ++ memset(&p1, 0, sizeof(p1));
509 ++
510 + switch (cmd) {
511 + case SIOCGETTUNNEL:
512 + if (dev == ip6n->fb_tnl_dev) {
513 +diff --git a/net/ipv6/route.c b/net/ipv6/route.c
514 +index 76e10019a0e9f..79b67f8048b5b 100644
515 +--- a/net/ipv6/route.c
516 ++++ b/net/ipv6/route.c
517 +@@ -3183,6 +3183,19 @@ static void ip6_route_mpath_notify(struct rt6_info *rt,
518 + inet6_rt_notify(RTM_NEWROUTE, rt, info, nlflags);
519 + }
520 +
521 ++static int fib6_gw_from_attr(struct in6_addr *gw, struct nlattr *nla,
522 ++ struct netlink_ext_ack *extack)
523 ++{
524 ++ if (nla_len(nla) < sizeof(*gw)) {
525 ++ NL_SET_ERR_MSG(extack, "Invalid IPv6 address in RTA_GATEWAY");
526 ++ return -EINVAL;
527 ++ }
528 ++
529 ++ *gw = nla_get_in6_addr(nla);
530 ++
531 ++ return 0;
532 ++}
533 ++
534 + static int ip6_route_multipath_add(struct fib6_config *cfg,
535 + struct netlink_ext_ack *extack)
536 + {
537 +@@ -3223,7 +3236,11 @@ static int ip6_route_multipath_add(struct fib6_config *cfg,
538 +
539 + nla = nla_find(attrs, attrlen, RTA_GATEWAY);
540 + if (nla) {
541 +- r_cfg.fc_gateway = nla_get_in6_addr(nla);
542 ++ err = fib6_gw_from_attr(&r_cfg.fc_gateway, nla,
543 ++ extack);
544 ++ if (err)
545 ++ goto cleanup;
546 ++
547 + r_cfg.fc_flags |= RTF_GATEWAY;
548 + }
549 + r_cfg.fc_encap = nla_find(attrs, attrlen, RTA_ENCAP);
550 +@@ -3346,7 +3363,13 @@ static int ip6_route_multipath_del(struct fib6_config *cfg,
551 +
552 + nla = nla_find(attrs, attrlen, RTA_GATEWAY);
553 + if (nla) {
554 +- nla_memcpy(&r_cfg.fc_gateway, nla, 16);
555 ++ err = fib6_gw_from_attr(&r_cfg.fc_gateway, nla,
556 ++ extack);
557 ++ if (err) {
558 ++ last_err = err;
559 ++ goto next_rtnh;
560 ++ }
561 ++
562 + r_cfg.fc_flags |= RTF_GATEWAY;
563 + }
564 + }
565 +@@ -3354,6 +3377,7 @@ static int ip6_route_multipath_del(struct fib6_config *cfg,
566 + if (err)
567 + last_err = err;
568 +
569 ++next_rtnh:
570 + rtnh = rtnh_next(rtnh, &remaining);
571 + }
572 +
573 +diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
574 +index a3ec3b1bb324a..fb554ca20dc84 100644
575 +--- a/net/mac80211/mlme.c
576 ++++ b/net/mac80211/mlme.c
577 +@@ -4501,7 +4501,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
578 + */
579 + if (new_sta) {
580 + u32 rates = 0, basic_rates = 0;
581 +- bool have_higher_than_11mbit;
582 ++ bool have_higher_than_11mbit = false;
583 + int min_rate = INT_MAX, min_rate_index = -1;
584 + const struct cfg80211_bss_ies *ies;
585 + int shift = ieee80211_vif_get_shift(&sdata->vif);
586 +diff --git a/net/phonet/pep.c b/net/phonet/pep.c
587 +index b0d958cd1823e..4c4a8a42ee884 100644
588 +--- a/net/phonet/pep.c
589 ++++ b/net/phonet/pep.c
590 +@@ -881,6 +881,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp,
591 +
592 + err = pep_accept_conn(newsk, skb);
593 + if (err) {
594 ++ __sock_put(sk);
595 + sock_put(newsk);
596 + newsk = NULL;
597 + goto drop;
598 +diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
599 +index 1e1d6146189fb..4701019768955 100644
600 +--- a/net/sched/sch_qfq.c
601 ++++ b/net/sched/sch_qfq.c
602 +@@ -1425,10 +1425,8 @@ static int qfq_init_qdisc(struct Qdisc *sch, struct nlattr *opt)
603 + if (err < 0)
604 + return err;
605 +
606 +- if (qdisc_dev(sch)->tx_queue_len + 1 > QFQ_MAX_AGG_CLASSES)
607 +- max_classes = QFQ_MAX_AGG_CLASSES;
608 +- else
609 +- max_classes = qdisc_dev(sch)->tx_queue_len + 1;
610 ++ max_classes = min_t(u64, (u64)qdisc_dev(sch)->tx_queue_len + 1,
611 ++ QFQ_MAX_AGG_CLASSES);
612 + /* max_cl_shift = floor(log_2(max_classes)) */
613 + max_cl_shift = __fls(max_classes);
614 + q->max_agg_classes = 1<<max_cl_shift;