Contents of /trunk/kernel-alx-legacy/patches-4.9/0364-4.9.265-all-fixes.patch
Parent Directory | Revision Log
Revision 3666 -
(show annotations)
(download)
Mon Oct 24 14:07:43 2022 UTC (23 months ago) by niro
File size: 28503 byte(s)
Mon Oct 24 14:07:43 2022 UTC (23 months ago) by niro
File size: 28503 byte(s)
-linux-4.9.265
1 | diff --git a/Makefile b/Makefile |
2 | index 2ae6f4b707dd9..f47e685de5f64 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,6 +1,6 @@ |
6 | VERSION = 4 |
7 | PATCHLEVEL = 9 |
8 | -SUBLEVEL = 264 |
9 | +SUBLEVEL = 265 |
10 | EXTRAVERSION = |
11 | NAME = Roaring Lionus |
12 | |
13 | diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h |
14 | index 6e834caa37206..7b10b3ef77394 100644 |
15 | --- a/arch/powerpc/include/asm/cpu_has_feature.h |
16 | +++ b/arch/powerpc/include/asm/cpu_has_feature.h |
17 | @@ -6,7 +6,7 @@ |
18 | #include <linux/bug.h> |
19 | #include <asm/cputable.h> |
20 | |
21 | -static inline bool early_cpu_has_feature(unsigned long feature) |
22 | +static __always_inline bool early_cpu_has_feature(unsigned long feature) |
23 | { |
24 | return !!((CPU_FTRS_ALWAYS & feature) || |
25 | (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature)); |
26 | @@ -45,7 +45,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature) |
27 | return static_branch_likely(&cpu_feature_keys[i]); |
28 | } |
29 | #else |
30 | -static inline bool cpu_has_feature(unsigned long feature) |
31 | +static __always_inline bool cpu_has_feature(unsigned long feature) |
32 | { |
33 | return early_cpu_has_feature(feature); |
34 | } |
35 | diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c |
36 | index d0e367959c916..20e24d4b917ab 100644 |
37 | --- a/drivers/extcon/extcon.c |
38 | +++ b/drivers/extcon/extcon.c |
39 | @@ -1200,6 +1200,7 @@ int extcon_dev_register(struct extcon_dev *edev) |
40 | sizeof(*edev->nh) * edev->max_supported, GFP_KERNEL); |
41 | if (!edev->nh) { |
42 | ret = -ENOMEM; |
43 | + device_unregister(&edev->dev); |
44 | goto err_dev; |
45 | } |
46 | |
47 | diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c |
48 | index 180f0a96528ce..646dca0a8d73e 100644 |
49 | --- a/drivers/firewire/nosy.c |
50 | +++ b/drivers/firewire/nosy.c |
51 | @@ -359,6 +359,7 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
52 | struct client *client = file->private_data; |
53 | spinlock_t *client_list_lock = &client->lynx->client_list_lock; |
54 | struct nosy_stats stats; |
55 | + int ret; |
56 | |
57 | switch (cmd) { |
58 | case NOSY_IOC_GET_STATS: |
59 | @@ -373,11 +374,15 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
60 | return 0; |
61 | |
62 | case NOSY_IOC_START: |
63 | + ret = -EBUSY; |
64 | spin_lock_irq(client_list_lock); |
65 | - list_add_tail(&client->link, &client->lynx->client_list); |
66 | + if (list_empty(&client->link)) { |
67 | + list_add_tail(&client->link, &client->lynx->client_list); |
68 | + ret = 0; |
69 | + } |
70 | spin_unlock_irq(client_list_lock); |
71 | |
72 | - return 0; |
73 | + return ret; |
74 | |
75 | case NOSY_IOC_STOP: |
76 | spin_lock_irq(client_list_lock); |
77 | diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c |
78 | index 04b60ed59ea06..4253ccb799756 100644 |
79 | --- a/drivers/net/wan/lmc/lmc_main.c |
80 | +++ b/drivers/net/wan/lmc/lmc_main.c |
81 | @@ -923,6 +923,8 @@ static int lmc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
82 | break; |
83 | default: |
84 | printk(KERN_WARNING "%s: LMC UNKNOWN CARD!\n", dev->name); |
85 | + unregister_hdlc_device(dev); |
86 | + return -EIO; |
87 | break; |
88 | } |
89 | |
90 | diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c |
91 | index ee2dcea1e54b9..17827a88b85e1 100644 |
92 | --- a/drivers/pinctrl/pinctrl-rockchip.c |
93 | +++ b/drivers/pinctrl/pinctrl-rockchip.c |
94 | @@ -2367,12 +2367,15 @@ static int __maybe_unused rockchip_pinctrl_suspend(struct device *dev) |
95 | static int __maybe_unused rockchip_pinctrl_resume(struct device *dev) |
96 | { |
97 | struct rockchip_pinctrl *info = dev_get_drvdata(dev); |
98 | - int ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX, |
99 | - rk3288_grf_gpio6c_iomux | |
100 | - GPIO6C6_SEL_WRITE_ENABLE); |
101 | + int ret; |
102 | |
103 | - if (ret) |
104 | - return ret; |
105 | + if (info->ctrl->type == RK3288) { |
106 | + ret = regmap_write(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX, |
107 | + rk3288_grf_gpio6c_iomux | |
108 | + GPIO6C6_SEL_WRITE_ENABLE); |
109 | + if (ret) |
110 | + return ret; |
111 | + } |
112 | |
113 | return pinctrl_force_default(info->pctl_dev); |
114 | } |
115 | diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h |
116 | index 07ea4fcf4f88e..983ec09da6503 100644 |
117 | --- a/drivers/scsi/qla2xxx/qla_target.h |
118 | +++ b/drivers/scsi/qla2xxx/qla_target.h |
119 | @@ -112,7 +112,6 @@ |
120 | (min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \ |
121 | QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0)) |
122 | #endif |
123 | -#endif |
124 | |
125 | #define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha)) \ |
126 | ? le16_to_cpu((iocb)->u.isp2x.target.extended) \ |
127 | @@ -323,6 +322,7 @@ struct ctio_to_2xxx { |
128 | #ifndef CTIO_RET_TYPE |
129 | #define CTIO_RET_TYPE 0x17 /* CTIO return entry */ |
130 | #define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */ |
131 | +#endif |
132 | |
133 | struct fcp_hdr { |
134 | uint8_t r_ctl; |
135 | diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c |
136 | index 618422ea3a412..0d58227431e43 100644 |
137 | --- a/drivers/scsi/st.c |
138 | +++ b/drivers/scsi/st.c |
139 | @@ -1267,8 +1267,8 @@ static int st_open(struct inode *inode, struct file *filp) |
140 | spin_lock(&st_use_lock); |
141 | if (STp->in_use) { |
142 | spin_unlock(&st_use_lock); |
143 | - scsi_tape_put(STp); |
144 | DEBC_printk(STp, "Device already in use.\n"); |
145 | + scsi_tape_put(STp); |
146 | return (-EBUSY); |
147 | } |
148 | |
149 | diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c |
150 | index 3ea15bb0e56ef..15b9cc8531f02 100644 |
151 | --- a/drivers/staging/comedi/drivers/cb_pcidas.c |
152 | +++ b/drivers/staging/comedi/drivers/cb_pcidas.c |
153 | @@ -1290,7 +1290,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev, |
154 | devpriv->amcc + AMCC_OP_REG_INTCSR); |
155 | |
156 | ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED, |
157 | - dev->board_name, dev); |
158 | + "cb_pcidas", dev); |
159 | if (ret) { |
160 | dev_dbg(dev->class_dev, "unable to allocate irq %d\n", |
161 | pcidev->irq); |
162 | diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c |
163 | index cb9c2699277e6..b202df1dcba05 100644 |
164 | --- a/drivers/staging/comedi/drivers/cb_pcidas64.c |
165 | +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c |
166 | @@ -4034,7 +4034,7 @@ static int auto_attach(struct comedi_device *dev, |
167 | init_stc_registers(dev); |
168 | |
169 | retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED, |
170 | - dev->board_name, dev); |
171 | + "cb_pcidas64", dev); |
172 | if (retval) { |
173 | dev_dbg(dev->class_dev, "unable to allocate irq %u\n", |
174 | pcidev->irq); |
175 | diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h |
176 | index b895a537d3e4f..e46da4e128e09 100644 |
177 | --- a/drivers/staging/rtl8192e/rtllib.h |
178 | +++ b/drivers/staging/rtl8192e/rtllib.h |
179 | @@ -1160,7 +1160,7 @@ struct rtllib_network { |
180 | bool bWithAironetIE; |
181 | bool bCkipSupported; |
182 | bool bCcxRmEnable; |
183 | - u16 CcxRmState[2]; |
184 | + u8 CcxRmState[2]; |
185 | bool bMBssidValid; |
186 | u8 MBssidMask; |
187 | u8 MBssid[ETH_ALEN]; |
188 | diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c |
189 | index c743182b933e6..247475aa522ee 100644 |
190 | --- a/drivers/staging/rtl8192e/rtllib_rx.c |
191 | +++ b/drivers/staging/rtl8192e/rtllib_rx.c |
192 | @@ -1986,7 +1986,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, |
193 | info_element->data[2] == 0x96 && |
194 | info_element->data[3] == 0x01) { |
195 | if (info_element->len == 6) { |
196 | - memcpy(network->CcxRmState, &info_element[4], 2); |
197 | + memcpy(network->CcxRmState, &info_element->data[4], 2); |
198 | if (network->CcxRmState[0] != 0) |
199 | network->bCcxRmEnable = true; |
200 | else |
201 | diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c |
202 | index 9f1a1a318a3df..97b5b021a2200 100644 |
203 | --- a/drivers/usb/class/cdc-acm.c |
204 | +++ b/drivers/usb/class/cdc-acm.c |
205 | @@ -335,8 +335,10 @@ static void acm_ctrl_irq(struct urb *urb) |
206 | acm->iocount.dsr++; |
207 | if (difference & ACM_CTRL_DCD) |
208 | acm->iocount.dcd++; |
209 | - if (newctrl & ACM_CTRL_BRK) |
210 | + if (newctrl & ACM_CTRL_BRK) { |
211 | acm->iocount.brk++; |
212 | + tty_insert_flip_char(&acm->port, 0, TTY_BREAK); |
213 | + } |
214 | if (newctrl & ACM_CTRL_RI) |
215 | acm->iocount.rng++; |
216 | if (newctrl & ACM_CTRL_FRAMING) |
217 | @@ -541,7 +543,8 @@ static void acm_port_dtr_rts(struct tty_port *port, int raise) |
218 | |
219 | res = acm_set_control(acm, val); |
220 | if (res && (acm->ctrl_caps & USB_CDC_CAP_LINE)) |
221 | - dev_err(&acm->control->dev, "failed to set dtr/rts\n"); |
222 | + /* This is broken in too many devices to spam the logs */ |
223 | + dev_dbg(&acm->control->dev, "failed to set dtr/rts\n"); |
224 | } |
225 | |
226 | static int acm_port_activate(struct tty_port *port, struct tty_struct *tty) |
227 | @@ -1457,6 +1460,11 @@ skip_countries: |
228 | |
229 | return 0; |
230 | alloc_fail8: |
231 | + if (!acm->combined_interfaces) { |
232 | + /* Clear driver data so that disconnect() returns early. */ |
233 | + usb_set_intfdata(data_interface, NULL); |
234 | + usb_driver_release_interface(&acm_driver, data_interface); |
235 | + } |
236 | if (acm->country_codes) { |
237 | device_remove_file(&acm->control->dev, |
238 | &dev_attr_wCountryCodes); |
239 | diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
240 | index 2fc735efc3dc5..cd43e11d74f34 100644 |
241 | --- a/drivers/usb/core/quirks.c |
242 | +++ b/drivers/usb/core/quirks.c |
243 | @@ -321,6 +321,10 @@ static const struct usb_device_id usb_quirk_list[] = { |
244 | /* DJI CineSSD */ |
245 | { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, |
246 | |
247 | + /* Fibocom L850-GL LTE Modem */ |
248 | + { USB_DEVICE(0x2cb7, 0x0007), .driver_info = |
249 | + USB_QUIRK_IGNORE_REMOTE_WAKEUP }, |
250 | + |
251 | /* INTEL VALUE SSD */ |
252 | { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, |
253 | |
254 | diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c |
255 | index c10875834a5a0..0fe26152bae59 100644 |
256 | --- a/drivers/usb/host/xhci-mtk.c |
257 | +++ b/drivers/usb/host/xhci-mtk.c |
258 | @@ -470,6 +470,13 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci) |
259 | xhci->quirks |= XHCI_SPURIOUS_SUCCESS; |
260 | if (mtk->lpm_support) |
261 | xhci->quirks |= XHCI_LPM_SUPPORT; |
262 | + |
263 | + /* |
264 | + * MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream, |
265 | + * and it's 3 when support it. |
266 | + */ |
267 | + if (xhci->hci_version < 0x100 && HCC_MAX_PSA(xhci->hcc_params) == 4) |
268 | + xhci->quirks |= XHCI_BROKEN_STREAMS; |
269 | } |
270 | |
271 | /* called during probe() after chip reset completes */ |
272 | @@ -636,7 +643,8 @@ static int xhci_mtk_probe(struct platform_device *pdev) |
273 | if (ret) |
274 | goto put_usb3_hcd; |
275 | |
276 | - if (HCC_MAX_PSA(xhci->hcc_params) >= 4) |
277 | + if (HCC_MAX_PSA(xhci->hcc_params) >= 4 && |
278 | + !(xhci->quirks & XHCI_BROKEN_STREAMS)) |
279 | xhci->shared_hcd->can_do_streams = 1; |
280 | |
281 | ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); |
282 | diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c |
283 | index b14e62f110752..d2431afeda847 100644 |
284 | --- a/drivers/vhost/vhost.c |
285 | +++ b/drivers/vhost/vhost.c |
286 | @@ -306,8 +306,8 @@ static void vhost_vq_reset(struct vhost_dev *dev, |
287 | vq->call_ctx = NULL; |
288 | vq->call = NULL; |
289 | vq->log_ctx = NULL; |
290 | - vhost_reset_is_le(vq); |
291 | vhost_disable_cross_endian(vq); |
292 | + vhost_reset_is_le(vq); |
293 | vq->busyloop_timeout = 0; |
294 | vq->umem = NULL; |
295 | vq->iotlb = NULL; |
296 | diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
297 | index aa97a3ed3d8f7..79c067f74253e 100644 |
298 | --- a/fs/ext4/inode.c |
299 | +++ b/fs/ext4/inode.c |
300 | @@ -1978,13 +1978,13 @@ static int __ext4_journalled_writepage(struct page *page, |
301 | if (!ret) |
302 | ret = err; |
303 | |
304 | - if (!ext4_has_inline_data(inode)) |
305 | - ext4_walk_page_buffers(NULL, page_bufs, 0, len, |
306 | - NULL, bput_one); |
307 | ext4_set_inode_state(inode, EXT4_STATE_JDATA); |
308 | out: |
309 | unlock_page(page); |
310 | out_no_pagelock: |
311 | + if (!inline_data && page_bufs) |
312 | + ext4_walk_page_buffers(NULL, page_bufs, 0, len, |
313 | + NULL, bput_one); |
314 | brelse(inode_bh); |
315 | return ret; |
316 | } |
317 | diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c |
318 | index e6e3eb8dd4d6c..bbda3ea7039f3 100644 |
319 | --- a/fs/ext4/namei.c |
320 | +++ b/fs/ext4/namei.c |
321 | @@ -3615,7 +3615,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, |
322 | */ |
323 | retval = -ENOENT; |
324 | if (!old.bh || le32_to_cpu(old.de->inode) != old.inode->i_ino) |
325 | - goto end_rename; |
326 | + goto release_bh; |
327 | |
328 | if ((old.dir != new.dir) && |
329 | ext4_encrypted_inode(new.dir) && |
330 | @@ -3629,7 +3629,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, |
331 | if (IS_ERR(new.bh)) { |
332 | retval = PTR_ERR(new.bh); |
333 | new.bh = NULL; |
334 | - goto end_rename; |
335 | + goto release_bh; |
336 | } |
337 | if (new.bh) { |
338 | if (!new.inode) { |
339 | @@ -3646,15 +3646,13 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, |
340 | handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits); |
341 | if (IS_ERR(handle)) { |
342 | retval = PTR_ERR(handle); |
343 | - handle = NULL; |
344 | - goto end_rename; |
345 | + goto release_bh; |
346 | } |
347 | } else { |
348 | whiteout = ext4_whiteout_for_rename(&old, credits, &handle); |
349 | if (IS_ERR(whiteout)) { |
350 | retval = PTR_ERR(whiteout); |
351 | - whiteout = NULL; |
352 | - goto end_rename; |
353 | + goto release_bh; |
354 | } |
355 | } |
356 | |
357 | @@ -3762,16 +3760,18 @@ end_rename: |
358 | ext4_resetent(handle, &old, |
359 | old.inode->i_ino, old_file_type); |
360 | drop_nlink(whiteout); |
361 | + ext4_orphan_add(handle, whiteout); |
362 | } |
363 | unlock_new_inode(whiteout); |
364 | + ext4_journal_stop(handle); |
365 | iput(whiteout); |
366 | - |
367 | + } else { |
368 | + ext4_journal_stop(handle); |
369 | } |
370 | +release_bh: |
371 | brelse(old.dir_bh); |
372 | brelse(old.bh); |
373 | brelse(new.bh); |
374 | - if (handle) |
375 | - ext4_journal_stop(handle); |
376 | return retval; |
377 | } |
378 | |
379 | diff --git a/fs/reiserfs/xattr.h b/fs/reiserfs/xattr.h |
380 | index 613ff5aef94ea..19ca3745301fd 100644 |
381 | --- a/fs/reiserfs/xattr.h |
382 | +++ b/fs/reiserfs/xattr.h |
383 | @@ -42,7 +42,7 @@ void reiserfs_security_free(struct reiserfs_security_handle *sec); |
384 | |
385 | static inline int reiserfs_xattrs_initialized(struct super_block *sb) |
386 | { |
387 | - return REISERFS_SB(sb)->priv_root != NULL; |
388 | + return REISERFS_SB(sb)->priv_root && REISERFS_SB(sb)->xattr_root; |
389 | } |
390 | |
391 | #define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header)) |
392 | diff --git a/kernel/audit.c b/kernel/audit.c |
393 | index af1e00f52bd01..7fa9020e728ea 100644 |
394 | --- a/kernel/audit.c |
395 | +++ b/kernel/audit.c |
396 | @@ -535,7 +535,7 @@ static int kauditd_thread(void *dummy) |
397 | return 0; |
398 | } |
399 | |
400 | -int audit_send_list(void *_dest) |
401 | +int audit_send_list_thread(void *_dest) |
402 | { |
403 | struct audit_netlink_list *dest = _dest; |
404 | struct sk_buff *skb; |
405 | @@ -580,6 +580,18 @@ out_kfree_skb: |
406 | return NULL; |
407 | } |
408 | |
409 | +static void audit_free_reply(struct audit_reply *reply) |
410 | +{ |
411 | + if (!reply) |
412 | + return; |
413 | + |
414 | + if (reply->skb) |
415 | + kfree_skb(reply->skb); |
416 | + if (reply->net) |
417 | + put_net(reply->net); |
418 | + kfree(reply); |
419 | +} |
420 | + |
421 | static int audit_send_reply_thread(void *arg) |
422 | { |
423 | struct audit_reply *reply = (struct audit_reply *)arg; |
424 | @@ -592,8 +604,8 @@ static int audit_send_reply_thread(void *arg) |
425 | /* Ignore failure. It'll only happen if the sender goes away, |
426 | because our timeout is set to infinite. */ |
427 | netlink_unicast(aunet->nlsk , reply->skb, reply->portid, 0); |
428 | - put_net(net); |
429 | - kfree(reply); |
430 | + reply->skb = NULL; |
431 | + audit_free_reply(reply); |
432 | return 0; |
433 | } |
434 | /** |
435 | @@ -606,36 +618,34 @@ static int audit_send_reply_thread(void *arg) |
436 | * @payload: payload data |
437 | * @size: payload size |
438 | * |
439 | - * Allocates an skb, builds the netlink message, and sends it to the port id. |
440 | - * No failure notifications. |
441 | + * Allocates a skb, builds the netlink message, and sends it to the port id. |
442 | */ |
443 | static void audit_send_reply(struct sk_buff *request_skb, int seq, int type, int done, |
444 | int multi, const void *payload, int size) |
445 | { |
446 | u32 portid = NETLINK_CB(request_skb).portid; |
447 | - struct net *net = sock_net(NETLINK_CB(request_skb).sk); |
448 | - struct sk_buff *skb; |
449 | struct task_struct *tsk; |
450 | - struct audit_reply *reply = kmalloc(sizeof(struct audit_reply), |
451 | - GFP_KERNEL); |
452 | + struct audit_reply *reply; |
453 | |
454 | + reply = kzalloc(sizeof(*reply), GFP_KERNEL); |
455 | if (!reply) |
456 | return; |
457 | |
458 | - skb = audit_make_reply(portid, seq, type, done, multi, payload, size); |
459 | - if (!skb) |
460 | - goto out; |
461 | + reply->skb = audit_make_reply(portid, seq, type, done, multi, payload, size); |
462 | + if (!reply->skb) |
463 | + goto err; |
464 | |
465 | - reply->net = get_net(net); |
466 | + reply->net = get_net(sock_net(NETLINK_CB(request_skb).sk)); |
467 | reply->portid = portid; |
468 | - reply->skb = skb; |
469 | |
470 | tsk = kthread_run(audit_send_reply_thread, reply, "audit_send_reply"); |
471 | - if (!IS_ERR(tsk)) |
472 | - return; |
473 | - kfree_skb(skb); |
474 | -out: |
475 | - kfree(reply); |
476 | + if (IS_ERR(tsk)) |
477 | + goto err; |
478 | + |
479 | + return; |
480 | + |
481 | +err: |
482 | + audit_free_reply(reply); |
483 | } |
484 | |
485 | /* |
486 | diff --git a/kernel/audit.h b/kernel/audit.h |
487 | index 431444c3708bf..2eaf450188374 100644 |
488 | --- a/kernel/audit.h |
489 | +++ b/kernel/audit.h |
490 | @@ -245,7 +245,7 @@ struct audit_netlink_list { |
491 | struct sk_buff_head q; |
492 | }; |
493 | |
494 | -int audit_send_list(void *); |
495 | +int audit_send_list_thread(void *); |
496 | |
497 | struct audit_net { |
498 | struct sock *nlsk; |
499 | diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c |
500 | index a71ff9965cba6..cd12d79d1b176 100644 |
501 | --- a/kernel/auditfilter.c |
502 | +++ b/kernel/auditfilter.c |
503 | @@ -1139,10 +1139,8 @@ int audit_rule_change(int type, __u32 portid, int seq, void *data, |
504 | int audit_list_rules_send(struct sk_buff *request_skb, int seq) |
505 | { |
506 | u32 portid = NETLINK_CB(request_skb).portid; |
507 | - struct net *net = sock_net(NETLINK_CB(request_skb).sk); |
508 | struct task_struct *tsk; |
509 | struct audit_netlink_list *dest; |
510 | - int err = 0; |
511 | |
512 | /* We can't just spew out the rules here because we might fill |
513 | * the available socket buffer space and deadlock waiting for |
514 | @@ -1150,10 +1148,10 @@ int audit_list_rules_send(struct sk_buff *request_skb, int seq) |
515 | * happen if we're actually running in the context of auditctl |
516 | * trying to _send_ the stuff */ |
517 | |
518 | - dest = kmalloc(sizeof(struct audit_netlink_list), GFP_KERNEL); |
519 | + dest = kmalloc(sizeof(*dest), GFP_KERNEL); |
520 | if (!dest) |
521 | return -ENOMEM; |
522 | - dest->net = get_net(net); |
523 | + dest->net = get_net(sock_net(NETLINK_CB(request_skb).sk)); |
524 | dest->portid = portid; |
525 | skb_queue_head_init(&dest->q); |
526 | |
527 | @@ -1161,14 +1159,15 @@ int audit_list_rules_send(struct sk_buff *request_skb, int seq) |
528 | audit_list_rules(portid, seq, &dest->q); |
529 | mutex_unlock(&audit_filter_mutex); |
530 | |
531 | - tsk = kthread_run(audit_send_list, dest, "audit_send_list"); |
532 | + tsk = kthread_run(audit_send_list_thread, dest, "audit_send_list"); |
533 | if (IS_ERR(tsk)) { |
534 | skb_queue_purge(&dest->q); |
535 | + put_net(dest->net); |
536 | kfree(dest); |
537 | - err = PTR_ERR(tsk); |
538 | + return PTR_ERR(tsk); |
539 | } |
540 | |
541 | - return err; |
542 | + return 0; |
543 | } |
544 | |
545 | int audit_comparator(u32 left, u32 op, u32 right) |
546 | diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c |
547 | index b87ab105fa22b..8c6b682b83b80 100644 |
548 | --- a/kernel/trace/trace.c |
549 | +++ b/kernel/trace/trace.c |
550 | @@ -2225,7 +2225,8 @@ static void __ftrace_trace_stack(struct ring_buffer *buffer, |
551 | size *= sizeof(unsigned long); |
552 | |
553 | event = trace_buffer_lock_reserve(buffer, TRACE_STACK, |
554 | - sizeof(*entry) + size, flags, pc); |
555 | + (sizeof(*entry) - sizeof(entry->caller)) + size, |
556 | + flags, pc); |
557 | if (!event) |
558 | goto out; |
559 | entry = ring_buffer_event_data(event); |
560 | diff --git a/mm/memory.c b/mm/memory.c |
561 | index d1cc9923320b4..be592d434ad89 100644 |
562 | --- a/mm/memory.c |
563 | +++ b/mm/memory.c |
564 | @@ -132,7 +132,7 @@ static int __init init_zero_pfn(void) |
565 | zero_pfn = page_to_pfn(ZERO_PAGE(0)); |
566 | return 0; |
567 | } |
568 | -core_initcall(init_zero_pfn); |
569 | +early_initcall(init_zero_pfn); |
570 | |
571 | |
572 | #if defined(SPLIT_RSS_COUNTING) |
573 | diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c |
574 | index 93209c009df58..a66de21671ace 100644 |
575 | --- a/net/appletalk/ddp.c |
576 | +++ b/net/appletalk/ddp.c |
577 | @@ -1575,8 +1575,8 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) |
578 | struct sk_buff *skb; |
579 | struct net_device *dev; |
580 | struct ddpehdr *ddp; |
581 | - int size; |
582 | - struct atalk_route *rt; |
583 | + int size, hard_header_len; |
584 | + struct atalk_route *rt, *rt_lo = NULL; |
585 | int err; |
586 | |
587 | if (flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT)) |
588 | @@ -1639,7 +1639,22 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) |
589 | SOCK_DEBUG(sk, "SK %p: Size needed %d, device %s\n", |
590 | sk, size, dev->name); |
591 | |
592 | - size += dev->hard_header_len; |
593 | + hard_header_len = dev->hard_header_len; |
594 | + /* Leave room for loopback hardware header if necessary */ |
595 | + if (usat->sat_addr.s_node == ATADDR_BCAST && |
596 | + (dev->flags & IFF_LOOPBACK || !(rt->flags & RTF_GATEWAY))) { |
597 | + struct atalk_addr at_lo; |
598 | + |
599 | + at_lo.s_node = 0; |
600 | + at_lo.s_net = 0; |
601 | + |
602 | + rt_lo = atrtr_find(&at_lo); |
603 | + |
604 | + if (rt_lo && rt_lo->dev->hard_header_len > hard_header_len) |
605 | + hard_header_len = rt_lo->dev->hard_header_len; |
606 | + } |
607 | + |
608 | + size += hard_header_len; |
609 | release_sock(sk); |
610 | skb = sock_alloc_send_skb(sk, size, (flags & MSG_DONTWAIT), &err); |
611 | lock_sock(sk); |
612 | @@ -1647,7 +1662,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) |
613 | goto out; |
614 | |
615 | skb_reserve(skb, ddp_dl->header_length); |
616 | - skb_reserve(skb, dev->hard_header_len); |
617 | + skb_reserve(skb, hard_header_len); |
618 | skb->dev = dev; |
619 | |
620 | SOCK_DEBUG(sk, "SK %p: Begin build.\n", sk); |
621 | @@ -1698,18 +1713,12 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) |
622 | /* loop back */ |
623 | skb_orphan(skb); |
624 | if (ddp->deh_dnode == ATADDR_BCAST) { |
625 | - struct atalk_addr at_lo; |
626 | - |
627 | - at_lo.s_node = 0; |
628 | - at_lo.s_net = 0; |
629 | - |
630 | - rt = atrtr_find(&at_lo); |
631 | - if (!rt) { |
632 | + if (!rt_lo) { |
633 | kfree_skb(skb); |
634 | err = -ENETUNREACH; |
635 | goto out; |
636 | } |
637 | - dev = rt->dev; |
638 | + dev = rt_lo->dev; |
639 | skb->dev = dev; |
640 | } |
641 | ddp_dl->request(ddp_dl, skb, dev->dev_addr); |
642 | diff --git a/net/core/filter.c b/net/core/filter.c |
643 | index e8c89d2d2bc04..94bf897485db0 100644 |
644 | --- a/net/core/filter.c |
645 | +++ b/net/core/filter.c |
646 | @@ -2120,10 +2120,7 @@ static u32 __bpf_skb_min_len(const struct sk_buff *skb) |
647 | return min_len; |
648 | } |
649 | |
650 | -static u32 __bpf_skb_max_len(const struct sk_buff *skb) |
651 | -{ |
652 | - return skb->dev->mtu + skb->dev->hard_header_len; |
653 | -} |
654 | +#define BPF_SKB_MAX_LEN SKB_MAX_ALLOC |
655 | |
656 | static int bpf_skb_grow_rcsum(struct sk_buff *skb, unsigned int new_len) |
657 | { |
658 | @@ -2144,7 +2141,7 @@ static int bpf_skb_trim_rcsum(struct sk_buff *skb, unsigned int new_len) |
659 | BPF_CALL_3(bpf_skb_change_tail, struct sk_buff *, skb, u32, new_len, |
660 | u64, flags) |
661 | { |
662 | - u32 max_len = __bpf_skb_max_len(skb); |
663 | + u32 max_len = BPF_SKB_MAX_LEN; |
664 | u32 min_len = __bpf_skb_min_len(skb); |
665 | int ret; |
666 | |
667 | diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c |
668 | index 9438873fc3c87..ae62c29472785 100644 |
669 | --- a/net/dccp/ipv6.c |
670 | +++ b/net/dccp/ipv6.c |
671 | @@ -317,6 +317,11 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) |
672 | if (!ipv6_unicast_destination(skb)) |
673 | return 0; /* discard, don't send a reset here */ |
674 | |
675 | + if (ipv6_addr_v4mapped(&ipv6_hdr(skb)->saddr)) { |
676 | + __IP6_INC_STATS(sock_net(sk), NULL, IPSTATS_MIB_INHDRERRORS); |
677 | + return 0; |
678 | + } |
679 | + |
680 | if (dccp_bad_service_code(sk, service)) { |
681 | dcb->dccpd_reset_code = DCCP_RESET_CODE_BAD_SERVICE_CODE; |
682 | goto drop; |
683 | diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c |
684 | index e726a61ae6dc1..aacfb4bce1533 100644 |
685 | --- a/net/ipv6/ip6_input.c |
686 | +++ b/net/ipv6/ip6_input.c |
687 | @@ -168,16 +168,6 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt |
688 | if (ipv6_addr_is_multicast(&hdr->saddr)) |
689 | goto err; |
690 | |
691 | - /* While RFC4291 is not explicit about v4mapped addresses |
692 | - * in IPv6 headers, it seems clear linux dual-stack |
693 | - * model can not deal properly with these. |
694 | - * Security models could be fooled by ::ffff:127.0.0.1 for example. |
695 | - * |
696 | - * https://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02 |
697 | - */ |
698 | - if (ipv6_addr_v4mapped(&hdr->saddr)) |
699 | - goto err; |
700 | - |
701 | skb->transport_header = skb->network_header + sizeof(*hdr); |
702 | IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); |
703 | |
704 | diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c |
705 | index 7b336b7803ffa..dfddf2bfa7e1a 100644 |
706 | --- a/net/ipv6/tcp_ipv6.c |
707 | +++ b/net/ipv6/tcp_ipv6.c |
708 | @@ -986,6 +986,11 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) |
709 | if (!ipv6_unicast_destination(skb)) |
710 | goto drop; |
711 | |
712 | + if (ipv6_addr_v4mapped(&ipv6_hdr(skb)->saddr)) { |
713 | + __IP6_INC_STATS(sock_net(sk), NULL, IPSTATS_MIB_INHDRERRORS); |
714 | + return 0; |
715 | + } |
716 | + |
717 | return tcp_conn_request(&tcp6_request_sock_ops, |
718 | &tcp_request_sock_ipv6_ops, sk, skb); |
719 | |
720 | diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c |
721 | index fd897d900d123..85ad23d9a8a9b 100644 |
722 | --- a/net/sunrpc/auth_gss/svcauth_gss.c |
723 | +++ b/net/sunrpc/auth_gss/svcauth_gss.c |
724 | @@ -1705,11 +1705,14 @@ static int |
725 | svcauth_gss_release(struct svc_rqst *rqstp) |
726 | { |
727 | struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data; |
728 | - struct rpc_gss_wire_cred *gc = &gsd->clcred; |
729 | + struct rpc_gss_wire_cred *gc; |
730 | struct xdr_buf *resbuf = &rqstp->rq_res; |
731 | int stat = -EINVAL; |
732 | struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id); |
733 | |
734 | + if (!gsd) |
735 | + goto out; |
736 | + gc = &gsd->clcred; |
737 | if (gc->gc_proc != RPC_GSS_PROC_DATA) |
738 | goto out; |
739 | /* Release can be called twice, but we only wrap once. */ |
740 | @@ -1750,10 +1753,10 @@ out_err: |
741 | if (rqstp->rq_cred.cr_group_info) |
742 | put_group_info(rqstp->rq_cred.cr_group_info); |
743 | rqstp->rq_cred.cr_group_info = NULL; |
744 | - if (gsd->rsci) |
745 | + if (gsd && gsd->rsci) { |
746 | cache_put(&gsd->rsci->h, sn->rsc_cache); |
747 | - gsd->rsci = NULL; |
748 | - |
749 | + gsd->rsci = NULL; |
750 | + } |
751 | return stat; |
752 | } |
753 | |
754 | diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c |
755 | index bd3a5ef8e59b9..2fecdfe49bae3 100644 |
756 | --- a/net/vmw_vsock/af_vsock.c |
757 | +++ b/net/vmw_vsock/af_vsock.c |
758 | @@ -650,6 +650,7 @@ struct sock *__vsock_create(struct net *net, |
759 | vsk->trusted = psk->trusted; |
760 | vsk->owner = get_cred(psk->owner); |
761 | vsk->connect_timeout = psk->connect_timeout; |
762 | + security_sk_clone(parent, sk); |
763 | } else { |
764 | vsk->trusted = ns_capable_noaudit(&init_user_ns, CAP_NET_ADMIN); |
765 | vsk->owner = get_current_cred(); |
766 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
767 | index b003cb07254a8..79c45046edc61 100644 |
768 | --- a/sound/pci/hda/patch_realtek.c |
769 | +++ b/sound/pci/hda/patch_realtek.c |
770 | @@ -4304,6 +4304,7 @@ static void alc_update_headset_jack_cb(struct hda_codec *codec, |
771 | struct alc_spec *spec = codec->spec; |
772 | spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; |
773 | snd_hda_gen_hp_automute(codec, jack); |
774 | + alc_update_headset_mode(codec); |
775 | } |
776 | |
777 | static void alc_probe_headset_mode(struct hda_codec *codec) |
778 | diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c |
779 | index 3cc1135fc2cd1..81fbbcaf8121c 100644 |
780 | --- a/sound/soc/codecs/rt5640.c |
781 | +++ b/sound/soc/codecs/rt5640.c |
782 | @@ -341,9 +341,9 @@ static bool rt5640_readable_register(struct device *dev, unsigned int reg) |
783 | } |
784 | |
785 | static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0); |
786 | -static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0); |
787 | +static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0); |
788 | static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); |
789 | -static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); |
790 | +static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000); |
791 | static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); |
792 | |
793 | /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */ |
794 | diff --git a/sound/soc/codecs/rt5651.c b/sound/soc/codecs/rt5651.c |
795 | index f0c9e25624748..acd5c30694e80 100644 |
796 | --- a/sound/soc/codecs/rt5651.c |
797 | +++ b/sound/soc/codecs/rt5651.c |
798 | @@ -287,9 +287,9 @@ static bool rt5651_readable_register(struct device *dev, unsigned int reg) |
799 | } |
800 | |
801 | static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -4650, 150, 0); |
802 | -static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0); |
803 | +static const DECLARE_TLV_DB_MINMAX(dac_vol_tlv, -6562, 0); |
804 | static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); |
805 | -static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); |
806 | +static const DECLARE_TLV_DB_MINMAX(adc_vol_tlv, -1762, 3000); |
807 | static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); |
808 | |
809 | /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */ |
810 | diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c |
811 | index 635818fcda002..21a007c264071 100644 |
812 | --- a/sound/soc/codecs/rt5659.c |
813 | +++ b/sound/soc/codecs/rt5659.c |
814 | @@ -3389,12 +3389,17 @@ static int rt5659_set_dai_sysclk(struct snd_soc_dai *dai, |
815 | struct snd_soc_codec *codec = dai->codec; |
816 | struct rt5659_priv *rt5659 = snd_soc_codec_get_drvdata(codec); |
817 | unsigned int reg_val = 0; |
818 | + int ret; |
819 | |
820 | if (freq == rt5659->sysclk && clk_id == rt5659->sysclk_src) |
821 | return 0; |
822 | |
823 | switch (clk_id) { |
824 | case RT5659_SCLK_S_MCLK: |
825 | + ret = clk_set_rate(rt5659->mclk, freq); |
826 | + if (ret) |
827 | + return ret; |
828 | + |
829 | reg_val |= RT5659_SCLK_SRC_MCLK; |
830 | break; |
831 | case RT5659_SCLK_S_PLL1: |
832 | diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c |
833 | index 0c2a1413a8f57..14e564e38f3c6 100644 |
834 | --- a/sound/soc/codecs/sgtl5000.c |
835 | +++ b/sound/soc/codecs/sgtl5000.c |
836 | @@ -75,7 +75,7 @@ static const struct reg_default sgtl5000_reg_defaults[] = { |
837 | { SGTL5000_DAP_EQ_BASS_BAND4, 0x002f }, |
838 | { SGTL5000_DAP_MAIN_CHAN, 0x8000 }, |
839 | { SGTL5000_DAP_MIX_CHAN, 0x0000 }, |
840 | - { SGTL5000_DAP_AVC_CTRL, 0x0510 }, |
841 | + { SGTL5000_DAP_AVC_CTRL, 0x5100 }, |
842 | { SGTL5000_DAP_AVC_THRESHOLD, 0x1473 }, |
843 | { SGTL5000_DAP_AVC_ATTACK, 0x0028 }, |
844 | { SGTL5000_DAP_AVC_DECAY, 0x0050 }, |
845 | diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c |
846 | index 664aff41f0718..6b9e6b57d58df 100644 |
847 | --- a/sound/usb/quirks.c |
848 | +++ b/sound/usb/quirks.c |
849 | @@ -1154,6 +1154,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) |
850 | case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */ |
851 | case USB_ID(0x2912, 0x30c8): /* Audioengine D1 */ |
852 | case USB_ID(0x413c, 0xa506): /* Dell AE515 sound bar */ |
853 | + case USB_ID(0x046d, 0x084c): /* Logitech ConferenceCam Connect */ |
854 | return true; |
855 | } |
856 | return false; |