1 |
commit: 36e3874e4ddec6052c2441ca4a9d6f2e8b5addd0 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 3 11:35:33 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 3 11:35:33 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=36e3874e |
7 |
|
8 |
Linux patch 4.4.226 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1225_linux-4.4.226.patch | 1266 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1270 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 6e7060b..a947a45 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -943,6 +943,10 @@ Patch: 1224_linux-4.4.225.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.4.225 |
23 |
|
24 |
+Patch: 1225_linux-4.4.226.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.4.226 |
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/1225_linux-4.4.226.patch b/1225_linux-4.4.226.patch |
33 |
new file mode 100644 |
34 |
index 0000000..c43e489 |
35 |
--- /dev/null |
36 |
+++ b/1225_linux-4.4.226.patch |
37 |
@@ -0,0 +1,1266 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 4e5362707405..1b8bc1f294db 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 4 |
45 |
+-SUBLEVEL = 225 |
46 |
++SUBLEVEL = 226 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Blurry Fish Butt |
49 |
+ |
50 |
+diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c |
51 |
+index 63741f2e8d01..d72f00310683 100644 |
52 |
+--- a/arch/parisc/mm/init.c |
53 |
++++ b/arch/parisc/mm/init.c |
54 |
+@@ -604,7 +604,7 @@ void __init mem_init(void) |
55 |
+ > BITS_PER_LONG); |
56 |
+ |
57 |
+ high_memory = __va((max_pfn << PAGE_SHIFT)); |
58 |
+- set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1); |
59 |
++ set_max_mapnr(max_low_pfn); |
60 |
+ free_all_bootmem(); |
61 |
+ |
62 |
+ #ifdef CONFIG_PA11 |
63 |
+diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h |
64 |
+index fe884e18fa6e..c7854a098b6b 100644 |
65 |
+--- a/arch/x86/include/asm/dma.h |
66 |
++++ b/arch/x86/include/asm/dma.h |
67 |
+@@ -73,7 +73,7 @@ |
68 |
+ #define MAX_DMA_PFN ((16UL * 1024 * 1024) >> PAGE_SHIFT) |
69 |
+ |
70 |
+ /* 4GB broken PCI/AGP hardware bus master zone */ |
71 |
+-#define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT) |
72 |
++#define MAX_DMA32_PFN (1UL << (32 - PAGE_SHIFT)) |
73 |
+ |
74 |
+ #ifdef CONFIG_X86_32 |
75 |
+ /* The maximum address that we can perform a DMA transfer to on this platform */ |
76 |
+diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c |
77 |
+index e449f22c8f29..edec88b21ff1 100644 |
78 |
+--- a/drivers/gpu/drm/drm_fb_helper.c |
79 |
++++ b/drivers/gpu/drm/drm_fb_helper.c |
80 |
+@@ -1256,7 +1256,7 @@ retry: |
81 |
+ goto fail; |
82 |
+ |
83 |
+ plane = mode_set->crtc->primary; |
84 |
+- plane_mask |= drm_plane_index(plane); |
85 |
++ plane_mask |= (1 << drm_plane_index(plane)); |
86 |
+ plane->old_fb = plane->fb; |
87 |
+ } |
88 |
+ |
89 |
+diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c |
90 |
+index 644faf3ae93a..245070950e87 100644 |
91 |
+--- a/drivers/gpu/drm/msm/msm_gem.c |
92 |
++++ b/drivers/gpu/drm/msm/msm_gem.c |
93 |
+@@ -116,17 +116,19 @@ static void put_pages(struct drm_gem_object *obj) |
94 |
+ struct msm_gem_object *msm_obj = to_msm_bo(obj); |
95 |
+ |
96 |
+ if (msm_obj->pages) { |
97 |
+- /* For non-cached buffers, ensure the new pages are clean |
98 |
+- * because display controller, GPU, etc. are not coherent: |
99 |
+- */ |
100 |
+- if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) |
101 |
+- dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl, |
102 |
+- msm_obj->sgt->nents, DMA_BIDIRECTIONAL); |
103 |
++ if (msm_obj->sgt) { |
104 |
++ /* For non-cached buffers, ensure the new |
105 |
++ * pages are clean because display controller, |
106 |
++ * GPU, etc. are not coherent: |
107 |
++ */ |
108 |
++ if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED)) |
109 |
++ dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl, |
110 |
++ msm_obj->sgt->nents, |
111 |
++ DMA_BIDIRECTIONAL); |
112 |
+ |
113 |
+- if (msm_obj->sgt) |
114 |
+ sg_free_table(msm_obj->sgt); |
115 |
+- |
116 |
+- kfree(msm_obj->sgt); |
117 |
++ kfree(msm_obj->sgt); |
118 |
++ } |
119 |
+ |
120 |
+ if (use_pages(obj)) |
121 |
+ drm_gem_put_pages(obj, msm_obj->pages, true, false); |
122 |
+diff --git a/drivers/infiniband/hw/qib/qib_sysfs.c b/drivers/infiniband/hw/qib/qib_sysfs.c |
123 |
+index 3ae82202cdb5..b33565f4409f 100644 |
124 |
+--- a/drivers/infiniband/hw/qib/qib_sysfs.c |
125 |
++++ b/drivers/infiniband/hw/qib/qib_sysfs.c |
126 |
+@@ -703,7 +703,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, |
127 |
+ qib_dev_err(dd, |
128 |
+ "Skipping linkcontrol sysfs info, (err %d) port %u\n", |
129 |
+ ret, port_num); |
130 |
+- goto bail; |
131 |
++ goto bail_link; |
132 |
+ } |
133 |
+ kobject_uevent(&ppd->pport_kobj, KOBJ_ADD); |
134 |
+ |
135 |
+@@ -713,7 +713,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, |
136 |
+ qib_dev_err(dd, |
137 |
+ "Skipping sl2vl sysfs info, (err %d) port %u\n", |
138 |
+ ret, port_num); |
139 |
+- goto bail_link; |
140 |
++ goto bail_sl; |
141 |
+ } |
142 |
+ kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD); |
143 |
+ |
144 |
+@@ -723,7 +723,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, |
145 |
+ qib_dev_err(dd, |
146 |
+ "Skipping diag_counters sysfs info, (err %d) port %u\n", |
147 |
+ ret, port_num); |
148 |
+- goto bail_sl; |
149 |
++ goto bail_diagc; |
150 |
+ } |
151 |
+ kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD); |
152 |
+ |
153 |
+@@ -736,7 +736,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num, |
154 |
+ qib_dev_err(dd, |
155 |
+ "Skipping Congestion Control sysfs info, (err %d) port %u\n", |
156 |
+ ret, port_num); |
157 |
+- goto bail_diagc; |
158 |
++ goto bail_cc; |
159 |
+ } |
160 |
+ |
161 |
+ kobject_uevent(&ppd->pport_cc_kobj, KOBJ_ADD); |
162 |
+@@ -818,6 +818,7 @@ void qib_verbs_unregister_sysfs(struct qib_devdata *dd) |
163 |
+ &cc_table_bin_attr); |
164 |
+ kobject_put(&ppd->pport_cc_kobj); |
165 |
+ } |
166 |
++ kobject_put(&ppd->diagc_kobj); |
167 |
+ kobject_put(&ppd->sl2vl_kobj); |
168 |
+ kobject_put(&ppd->pport_kobj); |
169 |
+ } |
170 |
+diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c |
171 |
+index e9ae3d500a55..700f018df668 100644 |
172 |
+--- a/drivers/input/evdev.c |
173 |
++++ b/drivers/input/evdev.c |
174 |
+@@ -342,20 +342,6 @@ static int evdev_fasync(int fd, struct file *file, int on) |
175 |
+ return fasync_helper(fd, file, on, &client->fasync); |
176 |
+ } |
177 |
+ |
178 |
+-static int evdev_flush(struct file *file, fl_owner_t id) |
179 |
+-{ |
180 |
+- struct evdev_client *client = file->private_data; |
181 |
+- struct evdev *evdev = client->evdev; |
182 |
+- |
183 |
+- mutex_lock(&evdev->mutex); |
184 |
+- |
185 |
+- if (evdev->exist && !client->revoked) |
186 |
+- input_flush_device(&evdev->handle, file); |
187 |
+- |
188 |
+- mutex_unlock(&evdev->mutex); |
189 |
+- return 0; |
190 |
+-} |
191 |
+- |
192 |
+ static void evdev_free(struct device *dev) |
193 |
+ { |
194 |
+ struct evdev *evdev = container_of(dev, struct evdev, dev); |
195 |
+@@ -469,6 +455,10 @@ static int evdev_release(struct inode *inode, struct file *file) |
196 |
+ unsigned int i; |
197 |
+ |
198 |
+ mutex_lock(&evdev->mutex); |
199 |
++ |
200 |
++ if (evdev->exist && !client->revoked) |
201 |
++ input_flush_device(&evdev->handle, file); |
202 |
++ |
203 |
+ evdev_ungrab(evdev, client); |
204 |
+ mutex_unlock(&evdev->mutex); |
205 |
+ |
206 |
+@@ -1331,7 +1321,6 @@ static const struct file_operations evdev_fops = { |
207 |
+ .compat_ioctl = evdev_ioctl_compat, |
208 |
+ #endif |
209 |
+ .fasync = evdev_fasync, |
210 |
+- .flush = evdev_flush, |
211 |
+ .llseek = no_llseek, |
212 |
+ }; |
213 |
+ |
214 |
+diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c |
215 |
+index 26476a64e663..54a6691d7d87 100644 |
216 |
+--- a/drivers/input/joystick/xpad.c |
217 |
++++ b/drivers/input/joystick/xpad.c |
218 |
+@@ -475,6 +475,16 @@ static const u8 xboxone_fw2015_init[] = { |
219 |
+ 0x05, 0x20, 0x00, 0x01, 0x00 |
220 |
+ }; |
221 |
+ |
222 |
++/* |
223 |
++ * This packet is required for Xbox One S (0x045e:0x02ea) |
224 |
++ * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to |
225 |
++ * initialize the controller that was previously used in |
226 |
++ * Bluetooth mode. |
227 |
++ */ |
228 |
++static const u8 xboxone_s_init[] = { |
229 |
++ 0x05, 0x20, 0x00, 0x0f, 0x06 |
230 |
++}; |
231 |
++ |
232 |
+ /* |
233 |
+ * This packet is required for the Titanfall 2 Xbox One pads |
234 |
+ * (0x0e6f:0x0165) to finish initialization and for Hori pads |
235 |
+@@ -533,6 +543,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = { |
236 |
+ XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init), |
237 |
+ XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init), |
238 |
+ XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init), |
239 |
++ XBOXONE_INIT_PKT(0x045e, 0x02ea, xboxone_s_init), |
240 |
++ XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init), |
241 |
+ XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1), |
242 |
+ XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2), |
243 |
+ XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init), |
244 |
+diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h |
245 |
+index a4e76084a2af..fd1e79013cf8 100644 |
246 |
+--- a/drivers/input/serio/i8042-x86ia64io.h |
247 |
++++ b/drivers/input/serio/i8042-x86ia64io.h |
248 |
+@@ -738,6 +738,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = { |
249 |
+ DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"), |
250 |
+ }, |
251 |
+ }, |
252 |
++ { |
253 |
++ /* Lenovo ThinkPad Twist S230u */ |
254 |
++ .matches = { |
255 |
++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), |
256 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"), |
257 |
++ }, |
258 |
++ }, |
259 |
+ { } |
260 |
+ }; |
261 |
+ |
262 |
+diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c |
263 |
+index 2c41107240de..499402a975b3 100644 |
264 |
+--- a/drivers/input/touchscreen/usbtouchscreen.c |
265 |
++++ b/drivers/input/touchscreen/usbtouchscreen.c |
266 |
+@@ -197,6 +197,7 @@ static const struct usb_device_id usbtouch_devices[] = { |
267 |
+ #endif |
268 |
+ |
269 |
+ #ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH |
270 |
++ {USB_DEVICE(0x255e, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, |
271 |
+ {USB_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, |
272 |
+ {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, |
273 |
+ {USB_DEVICE(0x6615, 0x0012), .driver_info = DEVTYPE_IRTOUCH_HIRES}, |
274 |
+diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c |
275 |
+index 589207176ffa..a1e7a73930fa 100644 |
276 |
+--- a/drivers/iommu/iommu.c |
277 |
++++ b/drivers/iommu/iommu.c |
278 |
+@@ -206,7 +206,7 @@ again: |
279 |
+ mutex_lock(&iommu_group_mutex); |
280 |
+ ida_remove(&iommu_group_ida, group->id); |
281 |
+ mutex_unlock(&iommu_group_mutex); |
282 |
+- kfree(group); |
283 |
++ kobject_put(&group->kobj); |
284 |
+ return ERR_PTR(ret); |
285 |
+ } |
286 |
+ |
287 |
+diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c |
288 |
+index 641a532b67cb..3f756fa2f603 100644 |
289 |
+--- a/drivers/net/bonding/bond_sysfs_slave.c |
290 |
++++ b/drivers/net/bonding/bond_sysfs_slave.c |
291 |
+@@ -153,8 +153,10 @@ int bond_sysfs_slave_add(struct slave *slave) |
292 |
+ |
293 |
+ err = kobject_init_and_add(&slave->kobj, &slave_ktype, |
294 |
+ &(slave->dev->dev.kobj), "bonding_slave"); |
295 |
+- if (err) |
296 |
++ if (err) { |
297 |
++ kobject_put(&slave->kobj); |
298 |
+ return err; |
299 |
++ } |
300 |
+ |
301 |
+ for (a = slave_attrs; *a; ++a) { |
302 |
+ err = sysfs_create_file(&slave->kobj, &((*a)->attr)); |
303 |
+diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c |
304 |
+index 5ac6e62f7dcc..0a4e9731d33b 100644 |
305 |
+--- a/drivers/net/ethernet/mellanox/mlx4/fw.c |
306 |
++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c |
307 |
+@@ -2522,7 +2522,7 @@ void mlx4_opreq_action(struct work_struct *work) |
308 |
+ if (err) { |
309 |
+ mlx4_err(dev, "Failed to retrieve required operation: %d\n", |
310 |
+ err); |
311 |
+- return; |
312 |
++ goto out; |
313 |
+ } |
314 |
+ MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET); |
315 |
+ MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET); |
316 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c |
317 |
+index 9b8599c2aca8..3f98c8361ccd 100644 |
318 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c |
319 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c |
320 |
+@@ -670,6 +670,7 @@ static void cmd_work_handler(struct work_struct *work) |
321 |
+ int alloc_ret; |
322 |
+ int cmd_mode; |
323 |
+ |
324 |
++ complete(&ent->handling); |
325 |
+ sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem; |
326 |
+ down(sem); |
327 |
+ if (!ent->page_queue) { |
328 |
+@@ -769,6 +770,12 @@ static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent) |
329 |
+ struct mlx5_cmd *cmd = &dev->cmd; |
330 |
+ int err; |
331 |
+ |
332 |
++ if (!wait_for_completion_timeout(&ent->handling, timeout) && |
333 |
++ cancel_work_sync(&ent->work)) { |
334 |
++ ent->ret = -ECANCELED; |
335 |
++ goto out_err; |
336 |
++ } |
337 |
++ |
338 |
+ if (cmd->mode == CMD_MODE_POLLING) { |
339 |
+ wait_for_completion(&ent->done); |
340 |
+ } else if (!wait_for_completion_timeout(&ent->done, timeout)) { |
341 |
+@@ -776,12 +783,17 @@ static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent) |
342 |
+ mlx5_cmd_comp_handler(dev, 1UL << ent->idx); |
343 |
+ } |
344 |
+ |
345 |
++out_err: |
346 |
+ err = ent->ret; |
347 |
+ |
348 |
+ if (err == -ETIMEDOUT) { |
349 |
+ mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n", |
350 |
+ mlx5_command_str(msg_to_opcode(ent->in)), |
351 |
+ msg_to_opcode(ent->in)); |
352 |
++ } else if (err == -ECANCELED) { |
353 |
++ mlx5_core_warn(dev, "%s(0x%x) canceled on out of queue timeout.\n", |
354 |
++ mlx5_command_str(msg_to_opcode(ent->in)), |
355 |
++ msg_to_opcode(ent->in)); |
356 |
+ } |
357 |
+ mlx5_core_dbg(dev, "err %d, delivery status %s(%d)\n", |
358 |
+ err, deliv_status_to_str(ent->status), ent->status); |
359 |
+@@ -826,6 +838,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in, |
360 |
+ |
361 |
+ ent->token = token; |
362 |
+ |
363 |
++ init_completion(&ent->handling); |
364 |
+ if (!callback) |
365 |
+ init_completion(&ent->done); |
366 |
+ |
367 |
+@@ -841,6 +854,8 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in, |
368 |
+ |
369 |
+ if (callback) |
370 |
+ goto out; |
371 |
++ if (err == -ECANCELED) |
372 |
++ goto out_free; |
373 |
+ |
374 |
+ err = wait_func(dev, ent); |
375 |
+ if (err == -ETIMEDOUT) |
376 |
+diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c |
377 |
+index 7f7aea9758e7..75ac5cc2fc23 100644 |
378 |
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c |
379 |
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c |
380 |
+@@ -3609,7 +3609,7 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev) |
381 |
+ ahw->diag_cnt = 0; |
382 |
+ ret = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_INTRPT_TEST); |
383 |
+ if (ret) |
384 |
+- goto fail_diag_irq; |
385 |
++ goto fail_mbx_args; |
386 |
+ |
387 |
+ if (adapter->flags & QLCNIC_MSIX_ENABLED) |
388 |
+ intrpt_id = ahw->intr_tbl[0].id; |
389 |
+@@ -3639,6 +3639,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev) |
390 |
+ |
391 |
+ done: |
392 |
+ qlcnic_free_mbx_args(&cmd); |
393 |
++ |
394 |
++fail_mbx_args: |
395 |
+ qlcnic_83xx_diag_free_res(netdev, drv_sds_rings); |
396 |
+ |
397 |
+ fail_diag_irq: |
398 |
+diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c |
399 |
+index 062bce9acde6..bfe7b55f9714 100644 |
400 |
+--- a/drivers/net/ethernet/sun/cassini.c |
401 |
++++ b/drivers/net/ethernet/sun/cassini.c |
402 |
+@@ -4980,7 +4980,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
403 |
+ cas_cacheline_size)) { |
404 |
+ dev_err(&pdev->dev, "Could not set PCI cache " |
405 |
+ "line size\n"); |
406 |
+- goto err_write_cacheline; |
407 |
++ goto err_out_free_res; |
408 |
+ } |
409 |
+ } |
410 |
+ #endif |
411 |
+@@ -5151,7 +5151,6 @@ err_out_iounmap: |
412 |
+ err_out_free_res: |
413 |
+ pci_release_regions(pdev); |
414 |
+ |
415 |
+-err_write_cacheline: |
416 |
+ /* Try to restore it in case the error occurred after we |
417 |
+ * set it. |
418 |
+ */ |
419 |
+diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c |
420 |
+index a3aaef4c53a3..0d2bcb33697f 100644 |
421 |
+--- a/drivers/s390/scsi/zfcp_fsf.c |
422 |
++++ b/drivers/s390/scsi/zfcp_fsf.c |
423 |
+@@ -1594,6 +1594,7 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port) |
424 |
+ { |
425 |
+ struct zfcp_qdio *qdio = wka_port->adapter->qdio; |
426 |
+ struct zfcp_fsf_req *req; |
427 |
++ unsigned long req_id = 0; |
428 |
+ int retval = -EIO; |
429 |
+ |
430 |
+ spin_lock_irq(&qdio->req_q_lock); |
431 |
+@@ -1616,6 +1617,8 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port) |
432 |
+ hton24(req->qtcb->bottom.support.d_id, wka_port->d_id); |
433 |
+ req->data = wka_port; |
434 |
+ |
435 |
++ req_id = req->req_id; |
436 |
++ |
437 |
+ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
438 |
+ retval = zfcp_fsf_req_send(req); |
439 |
+ if (retval) |
440 |
+@@ -1623,7 +1626,7 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port) |
441 |
+ out: |
442 |
+ spin_unlock_irq(&qdio->req_q_lock); |
443 |
+ if (!retval) |
444 |
+- zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req->req_id); |
445 |
++ zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req_id); |
446 |
+ return retval; |
447 |
+ } |
448 |
+ |
449 |
+@@ -1649,6 +1652,7 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port) |
450 |
+ { |
451 |
+ struct zfcp_qdio *qdio = wka_port->adapter->qdio; |
452 |
+ struct zfcp_fsf_req *req; |
453 |
++ unsigned long req_id = 0; |
454 |
+ int retval = -EIO; |
455 |
+ |
456 |
+ spin_lock_irq(&qdio->req_q_lock); |
457 |
+@@ -1671,6 +1675,8 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port) |
458 |
+ req->data = wka_port; |
459 |
+ req->qtcb->header.port_handle = wka_port->handle; |
460 |
+ |
461 |
++ req_id = req->req_id; |
462 |
++ |
463 |
+ zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
464 |
+ retval = zfcp_fsf_req_send(req); |
465 |
+ if (retval) |
466 |
+@@ -1678,7 +1684,7 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port) |
467 |
+ out: |
468 |
+ spin_unlock_irq(&qdio->req_q_lock); |
469 |
+ if (!retval) |
470 |
+- zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req->req_id); |
471 |
++ zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req_id); |
472 |
+ return retval; |
473 |
+ } |
474 |
+ |
475 |
+diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c |
476 |
+index a3dfefa33e3c..3f82014269f0 100644 |
477 |
+--- a/drivers/tty/serial/sc16is7xx.c |
478 |
++++ b/drivers/tty/serial/sc16is7xx.c |
479 |
+@@ -1489,10 +1489,12 @@ static int __init sc16is7xx_init(void) |
480 |
+ #endif |
481 |
+ return ret; |
482 |
+ |
483 |
++#ifdef CONFIG_SERIAL_SC16IS7XX_SPI |
484 |
+ err_spi: |
485 |
+ #ifdef CONFIG_SERIAL_SC16IS7XX_I2C |
486 |
+ i2c_del_driver(&sc16is7xx_i2c_uart_driver); |
487 |
+ #endif |
488 |
++#endif |
489 |
+ err_i2c: |
490 |
+ uart_unregister_driver(&sc16is7xx_uart); |
491 |
+ return ret; |
492 |
+diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c |
493 |
+index 81f3c9cb333c..b95900168a6b 100644 |
494 |
+--- a/drivers/usb/gadget/legacy/inode.c |
495 |
++++ b/drivers/usb/gadget/legacy/inode.c |
496 |
+@@ -1360,7 +1360,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) |
497 |
+ |
498 |
+ req->buf = dev->rbuf; |
499 |
+ req->context = NULL; |
500 |
+- value = -EOPNOTSUPP; |
501 |
+ switch (ctrl->bRequest) { |
502 |
+ |
503 |
+ case USB_REQ_GET_DESCRIPTOR: |
504 |
+@@ -1806,7 +1805,7 @@ static ssize_t |
505 |
+ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr) |
506 |
+ { |
507 |
+ struct dev_data *dev = fd->private_data; |
508 |
+- ssize_t value = len, length = len; |
509 |
++ ssize_t value, length = len; |
510 |
+ unsigned total; |
511 |
+ u32 tag; |
512 |
+ char *kbuf; |
513 |
+diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c |
514 |
+index 5731621984c6..82c9c9d068be 100644 |
515 |
+--- a/drivers/usb/renesas_usbhs/mod_gadget.c |
516 |
++++ b/drivers/usb/renesas_usbhs/mod_gadget.c |
517 |
+@@ -1103,7 +1103,6 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) |
518 |
+ ret = -ENOMEM; |
519 |
+ goto usbhs_mod_gadget_probe_err_gpriv; |
520 |
+ } |
521 |
+- spin_lock_init(&uep->lock); |
522 |
+ |
523 |
+ gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED); |
524 |
+ dev_info(dev, "%stransceiver found\n", |
525 |
+@@ -1151,6 +1150,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) |
526 |
+ uep->ep.name = uep->ep_name; |
527 |
+ uep->ep.ops = &usbhsg_ep_ops; |
528 |
+ INIT_LIST_HEAD(&uep->ep.ep_list); |
529 |
++ spin_lock_init(&uep->lock); |
530 |
+ |
531 |
+ /* init DCP */ |
532 |
+ if (usbhsg_is_dcp(uep)) { |
533 |
+diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c |
534 |
+index 164e5fedd7b6..eddf5746cf51 100644 |
535 |
+--- a/fs/binfmt_elf.c |
536 |
++++ b/fs/binfmt_elf.c |
537 |
+@@ -1726,7 +1726,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, |
538 |
+ (!regset->active || regset->active(t->task, regset) > 0)) { |
539 |
+ int ret; |
540 |
+ size_t size = regset->n * regset->size; |
541 |
+- void *data = kmalloc(size, GFP_KERNEL); |
542 |
++ void *data = kzalloc(size, GFP_KERNEL); |
543 |
+ if (unlikely(!data)) |
544 |
+ return 0; |
545 |
+ ret = regset->get(t->task, regset, |
546 |
+diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c |
547 |
+index c05ab2ec0fef..5df898fd0a0a 100644 |
548 |
+--- a/fs/cachefiles/rdwr.c |
549 |
++++ b/fs/cachefiles/rdwr.c |
550 |
+@@ -64,9 +64,9 @@ static int cachefiles_read_waiter(wait_queue_t *wait, unsigned mode, |
551 |
+ object = container_of(op->op.object, struct cachefiles_object, fscache); |
552 |
+ spin_lock(&object->work_lock); |
553 |
+ list_add_tail(&monitor->op_link, &op->to_do); |
554 |
++ fscache_enqueue_retrieval(op); |
555 |
+ spin_unlock(&object->work_lock); |
556 |
+ |
557 |
+- fscache_enqueue_retrieval(op); |
558 |
+ fscache_put_retrieval(op); |
559 |
+ return 0; |
560 |
+ } |
561 |
+diff --git a/fs/cifs/file.c b/fs/cifs/file.c |
562 |
+index 2ffdaedca7e9..b5a05092f862 100644 |
563 |
+--- a/fs/cifs/file.c |
564 |
++++ b/fs/cifs/file.c |
565 |
+@@ -3230,7 +3230,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset) |
566 |
+ * than it negotiated since it will refuse the read |
567 |
+ * then. |
568 |
+ */ |
569 |
+- if ((tcon->ses) && !(tcon->ses->capabilities & |
570 |
++ if (!(tcon->ses->capabilities & |
571 |
+ tcon->ses->server->vals->cap_large_files)) { |
572 |
+ current_read_size = min_t(uint, |
573 |
+ current_read_size, CIFSMaxBufSize); |
574 |
+diff --git a/include/asm-generic/asm-prototypes.h b/include/asm-generic/asm-prototypes.h |
575 |
+index df13637e4017..939869c772b1 100644 |
576 |
+--- a/include/asm-generic/asm-prototypes.h |
577 |
++++ b/include/asm-generic/asm-prototypes.h |
578 |
+@@ -1,7 +1,13 @@ |
579 |
+ #include <linux/bitops.h> |
580 |
++#undef __memset |
581 |
+ extern void *__memset(void *, int, __kernel_size_t); |
582 |
++#undef __memcpy |
583 |
+ extern void *__memcpy(void *, const void *, __kernel_size_t); |
584 |
++#undef __memmove |
585 |
+ extern void *__memmove(void *, const void *, __kernel_size_t); |
586 |
++#undef memset |
587 |
+ extern void *memset(void *, int, __kernel_size_t); |
588 |
++#undef memcpy |
589 |
+ extern void *memcpy(void *, const void *, __kernel_size_t); |
590 |
++#undef memmove |
591 |
+ extern void *memmove(void *, const void *, __kernel_size_t); |
592 |
+diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h |
593 |
+index 5d2add1a6c96..864fcfa1df41 100644 |
594 |
+--- a/include/asm-generic/topology.h |
595 |
++++ b/include/asm-generic/topology.h |
596 |
+@@ -51,7 +51,7 @@ |
597 |
+ #ifdef CONFIG_NEED_MULTIPLE_NODES |
598 |
+ #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask) |
599 |
+ #else |
600 |
+- #define cpumask_of_node(node) ((void)node, cpu_online_mask) |
601 |
++ #define cpumask_of_node(node) ((void)(node), cpu_online_mask) |
602 |
+ #endif |
603 |
+ #endif |
604 |
+ #ifndef pcibus_to_node |
605 |
+diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h |
606 |
+index 06cc39623d13..626139de5917 100644 |
607 |
+--- a/include/linux/mlx5/driver.h |
608 |
++++ b/include/linux/mlx5/driver.h |
609 |
+@@ -569,6 +569,7 @@ struct mlx5_cmd_work_ent { |
610 |
+ struct delayed_work cb_timeout_work; |
611 |
+ void *context; |
612 |
+ int idx; |
613 |
++ struct completion handling; |
614 |
+ struct completion done; |
615 |
+ struct mlx5_cmd *cmd; |
616 |
+ struct work_struct work; |
617 |
+diff --git a/include/linux/mm.h b/include/linux/mm.h |
618 |
+index 69fa3df9e712..03cf5526e445 100644 |
619 |
+--- a/include/linux/mm.h |
620 |
++++ b/include/linux/mm.h |
621 |
+@@ -446,7 +446,6 @@ static inline void page_mapcount_reset(struct page *page) |
622 |
+ |
623 |
+ static inline int page_mapcount(struct page *page) |
624 |
+ { |
625 |
+- VM_BUG_ON_PAGE(PageSlab(page), page); |
626 |
+ return atomic_read(&page->_mapcount) + 1; |
627 |
+ } |
628 |
+ |
629 |
+diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h |
630 |
+index 2ab2830316b7..aca42a2e79cf 100644 |
631 |
+--- a/include/linux/netfilter/nf_conntrack_pptp.h |
632 |
++++ b/include/linux/netfilter/nf_conntrack_pptp.h |
633 |
+@@ -4,7 +4,7 @@ |
634 |
+ |
635 |
+ #include <linux/netfilter/nf_conntrack_common.h> |
636 |
+ |
637 |
+-extern const char *const pptp_msg_name[]; |
638 |
++const char *pptp_msg_name(u_int16_t msg); |
639 |
+ |
640 |
+ /* state of the control session */ |
641 |
+ enum pptp_ctrlsess_state { |
642 |
+diff --git a/include/linux/printk.h b/include/linux/printk.h |
643 |
+index 9729565c25ff..9ccbdf2c1453 100644 |
644 |
+--- a/include/linux/printk.h |
645 |
++++ b/include/linux/printk.h |
646 |
+@@ -106,13 +106,13 @@ struct va_format { |
647 |
+ |
648 |
+ /* |
649 |
+ * Dummy printk for disabled debugging statements to use whilst maintaining |
650 |
+- * gcc's format and side-effect checking. |
651 |
++ * gcc's format checking. |
652 |
+ */ |
653 |
+-static inline __printf(1, 2) |
654 |
+-int no_printk(const char *fmt, ...) |
655 |
+-{ |
656 |
+- return 0; |
657 |
+-} |
658 |
++#define no_printk(fmt, ...) \ |
659 |
++do { \ |
660 |
++ if (0) \ |
661 |
++ printk(fmt, ##__VA_ARGS__); \ |
662 |
++} while (0) |
663 |
+ |
664 |
+ #ifdef CONFIG_EARLY_PRINTK |
665 |
+ extern asmlinkage __printf(1, 2) |
666 |
+diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h |
667 |
+index d77416963f05..72f3b0d65435 100644 |
668 |
+--- a/include/rdma/ib_addr.h |
669 |
++++ b/include/rdma/ib_addr.h |
670 |
+@@ -200,11 +200,13 @@ static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr, |
671 |
+ dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if); |
672 |
+ if (dev) { |
673 |
+ ip4 = in_dev_get(dev); |
674 |
+- if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) { |
675 |
++ if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) |
676 |
+ ipv6_addr_set_v4mapped(ip4->ifa_list->ifa_address, |
677 |
+ (struct in6_addr *)gid); |
678 |
++ |
679 |
++ if (ip4) |
680 |
+ in_dev_put(ip4); |
681 |
+- } |
682 |
++ |
683 |
+ dev_put(dev); |
684 |
+ } |
685 |
+ } |
686 |
+diff --git a/include/uapi/linux/l2tp.h b/include/uapi/linux/l2tp.h |
687 |
+index dedfb2b1832a..c3a5c99f565b 100644 |
688 |
+--- a/include/uapi/linux/l2tp.h |
689 |
++++ b/include/uapi/linux/l2tp.h |
690 |
+@@ -9,9 +9,8 @@ |
691 |
+ |
692 |
+ #include <linux/types.h> |
693 |
+ #include <linux/socket.h> |
694 |
+-#ifndef __KERNEL__ |
695 |
+-#include <netinet/in.h> |
696 |
+-#endif |
697 |
++#include <linux/in.h> |
698 |
++#include <linux/in6.h> |
699 |
+ |
700 |
+ #define IPPROTO_L2TP 115 |
701 |
+ |
702 |
+@@ -31,7 +30,7 @@ struct sockaddr_l2tpip { |
703 |
+ __u32 l2tp_conn_id; /* Connection ID of tunnel */ |
704 |
+ |
705 |
+ /* Pad to size of `struct sockaddr'. */ |
706 |
+- unsigned char __pad[sizeof(struct sockaddr) - |
707 |
++ unsigned char __pad[__SOCK_SIZE__ - |
708 |
+ sizeof(__kernel_sa_family_t) - |
709 |
+ sizeof(__be16) - sizeof(struct in_addr) - |
710 |
+ sizeof(__u32)]; |
711 |
+diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c |
712 |
+index 37ddb7bda651..ec7c7eda0774 100644 |
713 |
+--- a/kernel/irq/migration.c |
714 |
++++ b/kernel/irq/migration.c |
715 |
+@@ -7,17 +7,18 @@ |
716 |
+ void irq_move_masked_irq(struct irq_data *idata) |
717 |
+ { |
718 |
+ struct irq_desc *desc = irq_data_to_desc(idata); |
719 |
+- struct irq_chip *chip = desc->irq_data.chip; |
720 |
++ struct irq_data *data = &desc->irq_data; |
721 |
++ struct irq_chip *chip = data->chip; |
722 |
+ |
723 |
+- if (likely(!irqd_is_setaffinity_pending(&desc->irq_data))) |
724 |
++ if (likely(!irqd_is_setaffinity_pending(data))) |
725 |
+ return; |
726 |
+ |
727 |
+- irqd_clr_move_pending(&desc->irq_data); |
728 |
++ irqd_clr_move_pending(data); |
729 |
+ |
730 |
+ /* |
731 |
+ * Paranoia: cpu-local interrupts shouldn't be calling in here anyway. |
732 |
+ */ |
733 |
+- if (irqd_is_per_cpu(&desc->irq_data)) { |
734 |
++ if (irqd_is_per_cpu(data)) { |
735 |
+ WARN_ON(1); |
736 |
+ return; |
737 |
+ } |
738 |
+@@ -42,9 +43,20 @@ void irq_move_masked_irq(struct irq_data *idata) |
739 |
+ * For correct operation this depends on the caller |
740 |
+ * masking the irqs. |
741 |
+ */ |
742 |
+- if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) |
743 |
+- irq_do_set_affinity(&desc->irq_data, desc->pending_mask, false); |
744 |
+- |
745 |
++ if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) { |
746 |
++ int ret; |
747 |
++ |
748 |
++ ret = irq_do_set_affinity(data, desc->pending_mask, false); |
749 |
++ /* |
750 |
++ * If the there is a cleanup pending in the underlying |
751 |
++ * vector management, reschedule the move for the next |
752 |
++ * interrupt. Leave desc->pending_mask intact. |
753 |
++ */ |
754 |
++ if (ret == -EBUSY) { |
755 |
++ irqd_set_move_pending(data); |
756 |
++ return; |
757 |
++ } |
758 |
++ } |
759 |
+ cpumask_clear(desc->pending_mask); |
760 |
+ } |
761 |
+ |
762 |
+diff --git a/mm/vmalloc.c b/mm/vmalloc.c |
763 |
+index c9e6fc6a5fef..5dafd41d0732 100644 |
764 |
+--- a/mm/vmalloc.c |
765 |
++++ b/mm/vmalloc.c |
766 |
+@@ -1464,7 +1464,7 @@ static void __vunmap(const void *addr, int deallocate_pages) |
767 |
+ addr)) |
768 |
+ return; |
769 |
+ |
770 |
+- area = find_vmap_area((unsigned long)addr)->vm; |
771 |
++ area = find_vm_area(addr); |
772 |
+ if (unlikely(!area)) { |
773 |
+ WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n", |
774 |
+ addr); |
775 |
+diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c |
776 |
+index de55a3f001dc..02be8ee23271 100644 |
777 |
+--- a/net/ax25/af_ax25.c |
778 |
++++ b/net/ax25/af_ax25.c |
779 |
+@@ -639,8 +639,10 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname, |
780 |
+ break; |
781 |
+ |
782 |
+ case SO_BINDTODEVICE: |
783 |
+- if (optlen > IFNAMSIZ) |
784 |
+- optlen = IFNAMSIZ; |
785 |
++ if (optlen > IFNAMSIZ - 1) |
786 |
++ optlen = IFNAMSIZ - 1; |
787 |
++ |
788 |
++ memset(devname, 0, sizeof(devname)); |
789 |
+ |
790 |
+ if (copy_from_user(devname, optval, optlen)) { |
791 |
+ res = -EFAULT; |
792 |
+diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c |
793 |
+index 6e48aa69fa24..d7af67a3f19c 100644 |
794 |
+--- a/net/bridge/netfilter/nft_reject_bridge.c |
795 |
++++ b/net/bridge/netfilter/nft_reject_bridge.c |
796 |
+@@ -35,6 +35,12 @@ static void nft_reject_br_push_etherhdr(struct sk_buff *oldskb, |
797 |
+ ether_addr_copy(eth->h_dest, eth_hdr(oldskb)->h_source); |
798 |
+ eth->h_proto = eth_hdr(oldskb)->h_proto; |
799 |
+ skb_pull(nskb, ETH_HLEN); |
800 |
++ |
801 |
++ if (skb_vlan_tag_present(oldskb)) { |
802 |
++ u16 vid = skb_vlan_tag_get(oldskb); |
803 |
++ |
804 |
++ __vlan_hwaccel_put_tag(nskb, oldskb->vlan_proto, vid); |
805 |
++ } |
806 |
+ } |
807 |
+ |
808 |
+ /* We cannot use oldskb->dev, it can be either bridge device (NF_BRIDGE INPUT) |
809 |
+diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c |
810 |
+index 6f32d3086c7a..e2a0aed52983 100644 |
811 |
+--- a/net/core/rtnetlink.c |
812 |
++++ b/net/core/rtnetlink.c |
813 |
+@@ -2105,7 +2105,7 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm) |
814 |
+ } |
815 |
+ |
816 |
+ if (dev->rtnl_link_state == RTNL_LINK_INITIALIZED) { |
817 |
+- __dev_notify_flags(dev, old_flags, 0U); |
818 |
++ __dev_notify_flags(dev, old_flags, (old_flags ^ dev->flags)); |
819 |
+ } else { |
820 |
+ dev->rtnl_link_state = RTNL_LINK_INITIALIZED; |
821 |
+ __dev_notify_flags(dev, old_flags, ~0U); |
822 |
+diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c |
823 |
+index 2fd6fce1851f..abcf431376a0 100644 |
824 |
+--- a/net/ipv4/ip_vti.c |
825 |
++++ b/net/ipv4/ip_vti.c |
826 |
+@@ -51,7 +51,7 @@ static int vti_net_id __read_mostly; |
827 |
+ static int vti_tunnel_init(struct net_device *dev); |
828 |
+ |
829 |
+ static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi, |
830 |
+- int encap_type) |
831 |
++ int encap_type, bool update_skb_dev) |
832 |
+ { |
833 |
+ struct ip_tunnel *tunnel; |
834 |
+ const struct iphdr *iph = ip_hdr(skb); |
835 |
+@@ -66,6 +66,9 @@ static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi, |
836 |
+ |
837 |
+ XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel; |
838 |
+ |
839 |
++ if (update_skb_dev) |
840 |
++ skb->dev = tunnel->dev; |
841 |
++ |
842 |
+ return xfrm_input(skb, nexthdr, spi, encap_type); |
843 |
+ } |
844 |
+ |
845 |
+@@ -75,25 +78,43 @@ drop: |
846 |
+ return 0; |
847 |
+ } |
848 |
+ |
849 |
+-static int vti_input_ipip(struct sk_buff *skb, int nexthdr, __be32 spi, |
850 |
+- int encap_type) |
851 |
++static int vti_input_proto(struct sk_buff *skb, int nexthdr, __be32 spi, |
852 |
++ int encap_type) |
853 |
+ { |
854 |
+- struct ip_tunnel *tunnel; |
855 |
++ return vti_input(skb, nexthdr, spi, encap_type, false); |
856 |
++} |
857 |
++ |
858 |
++static int vti_rcv(struct sk_buff *skb, __be32 spi, bool update_skb_dev) |
859 |
++{ |
860 |
++ XFRM_SPI_SKB_CB(skb)->family = AF_INET; |
861 |
++ XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr); |
862 |
++ |
863 |
++ return vti_input(skb, ip_hdr(skb)->protocol, spi, 0, update_skb_dev); |
864 |
++} |
865 |
++ |
866 |
++static int vti_rcv_proto(struct sk_buff *skb) |
867 |
++{ |
868 |
++ return vti_rcv(skb, 0, false); |
869 |
++} |
870 |
++ |
871 |
++static int vti_rcv_tunnel(struct sk_buff *skb) |
872 |
++{ |
873 |
++ struct ip_tunnel_net *itn = net_generic(dev_net(skb->dev), vti_net_id); |
874 |
+ const struct iphdr *iph = ip_hdr(skb); |
875 |
+- struct net *net = dev_net(skb->dev); |
876 |
+- struct ip_tunnel_net *itn = net_generic(net, vti_net_id); |
877 |
++ struct ip_tunnel *tunnel; |
878 |
+ |
879 |
+ tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, TUNNEL_NO_KEY, |
880 |
+ iph->saddr, iph->daddr, 0); |
881 |
+ if (tunnel) { |
882 |
++ struct tnl_ptk_info tpi = { |
883 |
++ .proto = htons(ETH_P_IP), |
884 |
++ }; |
885 |
++ |
886 |
+ if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) |
887 |
+ goto drop; |
888 |
+- |
889 |
+- XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel; |
890 |
+- |
891 |
+- skb->dev = tunnel->dev; |
892 |
+- |
893 |
+- return xfrm_input(skb, nexthdr, spi, encap_type); |
894 |
++ if (iptunnel_pull_header(skb, 0, tpi.proto)) |
895 |
++ goto drop; |
896 |
++ return ip_tunnel_rcv(tunnel, skb, &tpi, NULL, false); |
897 |
+ } |
898 |
+ |
899 |
+ return -EINVAL; |
900 |
+@@ -102,22 +123,6 @@ drop: |
901 |
+ return 0; |
902 |
+ } |
903 |
+ |
904 |
+-static int vti_rcv(struct sk_buff *skb) |
905 |
+-{ |
906 |
+- XFRM_SPI_SKB_CB(skb)->family = AF_INET; |
907 |
+- XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr); |
908 |
+- |
909 |
+- return vti_input(skb, ip_hdr(skb)->protocol, 0, 0); |
910 |
+-} |
911 |
+- |
912 |
+-static int vti_rcv_ipip(struct sk_buff *skb) |
913 |
+-{ |
914 |
+- XFRM_SPI_SKB_CB(skb)->family = AF_INET; |
915 |
+- XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr); |
916 |
+- |
917 |
+- return vti_input_ipip(skb, ip_hdr(skb)->protocol, ip_hdr(skb)->saddr, 0); |
918 |
+-} |
919 |
+- |
920 |
+ static int vti_rcv_cb(struct sk_buff *skb, int err) |
921 |
+ { |
922 |
+ unsigned short family; |
923 |
+@@ -452,31 +457,31 @@ static void __net_init vti_fb_tunnel_init(struct net_device *dev) |
924 |
+ } |
925 |
+ |
926 |
+ static struct xfrm4_protocol vti_esp4_protocol __read_mostly = { |
927 |
+- .handler = vti_rcv, |
928 |
+- .input_handler = vti_input, |
929 |
++ .handler = vti_rcv_proto, |
930 |
++ .input_handler = vti_input_proto, |
931 |
+ .cb_handler = vti_rcv_cb, |
932 |
+ .err_handler = vti4_err, |
933 |
+ .priority = 100, |
934 |
+ }; |
935 |
+ |
936 |
+ static struct xfrm4_protocol vti_ah4_protocol __read_mostly = { |
937 |
+- .handler = vti_rcv, |
938 |
+- .input_handler = vti_input, |
939 |
++ .handler = vti_rcv_proto, |
940 |
++ .input_handler = vti_input_proto, |
941 |
+ .cb_handler = vti_rcv_cb, |
942 |
+ .err_handler = vti4_err, |
943 |
+ .priority = 100, |
944 |
+ }; |
945 |
+ |
946 |
+ static struct xfrm4_protocol vti_ipcomp4_protocol __read_mostly = { |
947 |
+- .handler = vti_rcv, |
948 |
+- .input_handler = vti_input, |
949 |
++ .handler = vti_rcv_proto, |
950 |
++ .input_handler = vti_input_proto, |
951 |
+ .cb_handler = vti_rcv_cb, |
952 |
+ .err_handler = vti4_err, |
953 |
+ .priority = 100, |
954 |
+ }; |
955 |
+ |
956 |
+ static struct xfrm_tunnel ipip_handler __read_mostly = { |
957 |
+- .handler = vti_rcv_ipip, |
958 |
++ .handler = vti_rcv_tunnel, |
959 |
+ .err_handler = vti4_err, |
960 |
+ .priority = 0, |
961 |
+ }; |
962 |
+diff --git a/net/ipv4/netfilter/nf_nat_pptp.c b/net/ipv4/netfilter/nf_nat_pptp.c |
963 |
+index b3ca21b2ba9b..ddbf93e70069 100644 |
964 |
+--- a/net/ipv4/netfilter/nf_nat_pptp.c |
965 |
++++ b/net/ipv4/netfilter/nf_nat_pptp.c |
966 |
+@@ -156,8 +156,7 @@ pptp_outbound_pkt(struct sk_buff *skb, |
967 |
+ break; |
968 |
+ default: |
969 |
+ pr_debug("unknown outbound packet 0x%04x:%s\n", msg, |
970 |
+- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : |
971 |
+- pptp_msg_name[0]); |
972 |
++ pptp_msg_name(msg)); |
973 |
+ /* fall through */ |
974 |
+ case PPTP_SET_LINK_INFO: |
975 |
+ /* only need to NAT in case PAC is behind NAT box */ |
976 |
+@@ -250,9 +249,7 @@ pptp_inbound_pkt(struct sk_buff *skb, |
977 |
+ pcid_off = offsetof(union pptp_ctrl_union, setlink.peersCallID); |
978 |
+ break; |
979 |
+ default: |
980 |
+- pr_debug("unknown inbound packet %s\n", |
981 |
+- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : |
982 |
+- pptp_msg_name[0]); |
983 |
++ pr_debug("unknown inbound packet %s\n", pptp_msg_name(msg)); |
984 |
+ /* fall through */ |
985 |
+ case PPTP_START_SESSION_REQUEST: |
986 |
+ case PPTP_START_SESSION_REPLY: |
987 |
+diff --git a/net/ipv4/route.c b/net/ipv4/route.c |
988 |
+index 325083464dbd..542f6e0f438f 100644 |
989 |
+--- a/net/ipv4/route.c |
990 |
++++ b/net/ipv4/route.c |
991 |
+@@ -477,18 +477,16 @@ u32 ip_idents_reserve(u32 hash, int segs) |
992 |
+ atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ; |
993 |
+ u32 old = ACCESS_ONCE(*p_tstamp); |
994 |
+ u32 now = (u32)jiffies; |
995 |
+- u32 new, delta = 0; |
996 |
++ u32 delta = 0; |
997 |
+ |
998 |
+ if (old != now && cmpxchg(p_tstamp, old, now) == old) |
999 |
+ delta = prandom_u32_max(now - old); |
1000 |
+ |
1001 |
+- /* Do not use atomic_add_return() as it makes UBSAN unhappy */ |
1002 |
+- do { |
1003 |
+- old = (u32)atomic_read(p_id); |
1004 |
+- new = old + delta + segs; |
1005 |
+- } while (atomic_cmpxchg(p_id, old, new) != old); |
1006 |
+- |
1007 |
+- return new - segs; |
1008 |
++ /* If UBSAN reports an error there, please make sure your compiler |
1009 |
++ * supports -fno-strict-overflow before reporting it that was a bug |
1010 |
++ * in UBSAN, and it has been fixed in GCC-8. |
1011 |
++ */ |
1012 |
++ return atomic_add_return(segs + delta, p_id) - segs; |
1013 |
+ } |
1014 |
+ EXPORT_SYMBOL(ip_idents_reserve); |
1015 |
+ |
1016 |
+diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
1017 |
+index c3944757ac8d..a1f6cd1a496b 100644 |
1018 |
+--- a/net/mac80211/sta_info.c |
1019 |
++++ b/net/mac80211/sta_info.c |
1020 |
+@@ -555,6 +555,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) |
1021 |
+ __cleanup_single_sta(sta); |
1022 |
+ out_err: |
1023 |
+ mutex_unlock(&local->sta_mtx); |
1024 |
++ kfree(sinfo); |
1025 |
+ rcu_read_lock(); |
1026 |
+ return err; |
1027 |
+ } |
1028 |
+diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c |
1029 |
+index bbede95c9f68..085711b35a99 100644 |
1030 |
+--- a/net/netfilter/ipset/ip_set_list_set.c |
1031 |
++++ b/net/netfilter/ipset/ip_set_list_set.c |
1032 |
+@@ -60,7 +60,7 @@ list_set_ktest(struct ip_set *set, const struct sk_buff *skb, |
1033 |
+ /* Don't lookup sub-counters at all */ |
1034 |
+ opt->cmdflags &= ~IPSET_FLAG_MATCH_COUNTERS; |
1035 |
+ if (opt->cmdflags & IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE) |
1036 |
+- opt->cmdflags &= ~IPSET_FLAG_SKIP_COUNTER_UPDATE; |
1037 |
++ opt->cmdflags |= IPSET_FLAG_SKIP_COUNTER_UPDATE; |
1038 |
+ list_for_each_entry_rcu(e, &map->members, list) { |
1039 |
+ if (SET_WITH_TIMEOUT(set) && |
1040 |
+ ip_set_timeout_expired(ext_timeout(e, set))) |
1041 |
+diff --git a/net/netfilter/nf_conntrack_pptp.c b/net/netfilter/nf_conntrack_pptp.c |
1042 |
+index 5588c7ae1ac2..9f9f92d637ad 100644 |
1043 |
+--- a/net/netfilter/nf_conntrack_pptp.c |
1044 |
++++ b/net/netfilter/nf_conntrack_pptp.c |
1045 |
+@@ -71,24 +71,32 @@ EXPORT_SYMBOL_GPL(nf_nat_pptp_hook_expectfn); |
1046 |
+ |
1047 |
+ #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG) |
1048 |
+ /* PptpControlMessageType names */ |
1049 |
+-const char *const pptp_msg_name[] = { |
1050 |
+- "UNKNOWN_MESSAGE", |
1051 |
+- "START_SESSION_REQUEST", |
1052 |
+- "START_SESSION_REPLY", |
1053 |
+- "STOP_SESSION_REQUEST", |
1054 |
+- "STOP_SESSION_REPLY", |
1055 |
+- "ECHO_REQUEST", |
1056 |
+- "ECHO_REPLY", |
1057 |
+- "OUT_CALL_REQUEST", |
1058 |
+- "OUT_CALL_REPLY", |
1059 |
+- "IN_CALL_REQUEST", |
1060 |
+- "IN_CALL_REPLY", |
1061 |
+- "IN_CALL_CONNECT", |
1062 |
+- "CALL_CLEAR_REQUEST", |
1063 |
+- "CALL_DISCONNECT_NOTIFY", |
1064 |
+- "WAN_ERROR_NOTIFY", |
1065 |
+- "SET_LINK_INFO" |
1066 |
++static const char *const pptp_msg_name_array[PPTP_MSG_MAX + 1] = { |
1067 |
++ [0] = "UNKNOWN_MESSAGE", |
1068 |
++ [PPTP_START_SESSION_REQUEST] = "START_SESSION_REQUEST", |
1069 |
++ [PPTP_START_SESSION_REPLY] = "START_SESSION_REPLY", |
1070 |
++ [PPTP_STOP_SESSION_REQUEST] = "STOP_SESSION_REQUEST", |
1071 |
++ [PPTP_STOP_SESSION_REPLY] = "STOP_SESSION_REPLY", |
1072 |
++ [PPTP_ECHO_REQUEST] = "ECHO_REQUEST", |
1073 |
++ [PPTP_ECHO_REPLY] = "ECHO_REPLY", |
1074 |
++ [PPTP_OUT_CALL_REQUEST] = "OUT_CALL_REQUEST", |
1075 |
++ [PPTP_OUT_CALL_REPLY] = "OUT_CALL_REPLY", |
1076 |
++ [PPTP_IN_CALL_REQUEST] = "IN_CALL_REQUEST", |
1077 |
++ [PPTP_IN_CALL_REPLY] = "IN_CALL_REPLY", |
1078 |
++ [PPTP_IN_CALL_CONNECT] = "IN_CALL_CONNECT", |
1079 |
++ [PPTP_CALL_CLEAR_REQUEST] = "CALL_CLEAR_REQUEST", |
1080 |
++ [PPTP_CALL_DISCONNECT_NOTIFY] = "CALL_DISCONNECT_NOTIFY", |
1081 |
++ [PPTP_WAN_ERROR_NOTIFY] = "WAN_ERROR_NOTIFY", |
1082 |
++ [PPTP_SET_LINK_INFO] = "SET_LINK_INFO" |
1083 |
+ }; |
1084 |
++ |
1085 |
++const char *pptp_msg_name(u_int16_t msg) |
1086 |
++{ |
1087 |
++ if (msg > PPTP_MSG_MAX) |
1088 |
++ return pptp_msg_name_array[0]; |
1089 |
++ |
1090 |
++ return pptp_msg_name_array[msg]; |
1091 |
++} |
1092 |
+ EXPORT_SYMBOL(pptp_msg_name); |
1093 |
+ #endif |
1094 |
+ |
1095 |
+@@ -278,7 +286,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1096 |
+ typeof(nf_nat_pptp_hook_inbound) nf_nat_pptp_inbound; |
1097 |
+ |
1098 |
+ msg = ntohs(ctlh->messageType); |
1099 |
+- pr_debug("inbound control message %s\n", pptp_msg_name[msg]); |
1100 |
++ pr_debug("inbound control message %s\n", pptp_msg_name(msg)); |
1101 |
+ |
1102 |
+ switch (msg) { |
1103 |
+ case PPTP_START_SESSION_REPLY: |
1104 |
+@@ -313,7 +321,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1105 |
+ pcid = pptpReq->ocack.peersCallID; |
1106 |
+ if (info->pns_call_id != pcid) |
1107 |
+ goto invalid; |
1108 |
+- pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name[msg], |
1109 |
++ pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name(msg), |
1110 |
+ ntohs(cid), ntohs(pcid)); |
1111 |
+ |
1112 |
+ if (pptpReq->ocack.resultCode == PPTP_OUTCALL_CONNECT) { |
1113 |
+@@ -330,7 +338,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1114 |
+ goto invalid; |
1115 |
+ |
1116 |
+ cid = pptpReq->icreq.callID; |
1117 |
+- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid)); |
1118 |
++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid)); |
1119 |
+ info->cstate = PPTP_CALL_IN_REQ; |
1120 |
+ info->pac_call_id = cid; |
1121 |
+ break; |
1122 |
+@@ -349,7 +357,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1123 |
+ if (info->pns_call_id != pcid) |
1124 |
+ goto invalid; |
1125 |
+ |
1126 |
+- pr_debug("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(pcid)); |
1127 |
++ pr_debug("%s, PCID=%X\n", pptp_msg_name(msg), ntohs(pcid)); |
1128 |
+ info->cstate = PPTP_CALL_IN_CONF; |
1129 |
+ |
1130 |
+ /* we expect a GRE connection from PAC to PNS */ |
1131 |
+@@ -359,7 +367,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1132 |
+ case PPTP_CALL_DISCONNECT_NOTIFY: |
1133 |
+ /* server confirms disconnect */ |
1134 |
+ cid = pptpReq->disc.callID; |
1135 |
+- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid)); |
1136 |
++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid)); |
1137 |
+ info->cstate = PPTP_CALL_NONE; |
1138 |
+ |
1139 |
+ /* untrack this call id, unexpect GRE packets */ |
1140 |
+@@ -386,7 +394,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1141 |
+ invalid: |
1142 |
+ pr_debug("invalid %s: type=%d cid=%u pcid=%u " |
1143 |
+ "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n", |
1144 |
+- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : pptp_msg_name[0], |
1145 |
++ pptp_msg_name(msg), |
1146 |
+ msg, ntohs(cid), ntohs(pcid), info->cstate, info->sstate, |
1147 |
+ ntohs(info->pns_call_id), ntohs(info->pac_call_id)); |
1148 |
+ return NF_ACCEPT; |
1149 |
+@@ -406,7 +414,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1150 |
+ typeof(nf_nat_pptp_hook_outbound) nf_nat_pptp_outbound; |
1151 |
+ |
1152 |
+ msg = ntohs(ctlh->messageType); |
1153 |
+- pr_debug("outbound control message %s\n", pptp_msg_name[msg]); |
1154 |
++ pr_debug("outbound control message %s\n", pptp_msg_name(msg)); |
1155 |
+ |
1156 |
+ switch (msg) { |
1157 |
+ case PPTP_START_SESSION_REQUEST: |
1158 |
+@@ -428,7 +436,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1159 |
+ info->cstate = PPTP_CALL_OUT_REQ; |
1160 |
+ /* track PNS call id */ |
1161 |
+ cid = pptpReq->ocreq.callID; |
1162 |
+- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid)); |
1163 |
++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid)); |
1164 |
+ info->pns_call_id = cid; |
1165 |
+ break; |
1166 |
+ |
1167 |
+@@ -442,7 +450,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1168 |
+ pcid = pptpReq->icack.peersCallID; |
1169 |
+ if (info->pac_call_id != pcid) |
1170 |
+ goto invalid; |
1171 |
+- pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name[msg], |
1172 |
++ pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name(msg), |
1173 |
+ ntohs(cid), ntohs(pcid)); |
1174 |
+ |
1175 |
+ if (pptpReq->icack.resultCode == PPTP_INCALL_ACCEPT) { |
1176 |
+@@ -482,7 +490,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff, |
1177 |
+ invalid: |
1178 |
+ pr_debug("invalid %s: type=%d cid=%u pcid=%u " |
1179 |
+ "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n", |
1180 |
+- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : pptp_msg_name[0], |
1181 |
++ pptp_msg_name(msg), |
1182 |
+ msg, ntohs(cid), ntohs(pcid), info->cstate, info->sstate, |
1183 |
+ ntohs(info->pns_call_id), ntohs(info->pac_call_id)); |
1184 |
+ return NF_ACCEPT; |
1185 |
+diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c |
1186 |
+index adaaaaad527d..a9a72f7e0cd7 100644 |
1187 |
+--- a/net/sctp/sm_statefuns.c |
1188 |
++++ b/net/sctp/sm_statefuns.c |
1189 |
+@@ -1793,12 +1793,13 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net, |
1190 |
+ /* Update the content of current association. */ |
1191 |
+ sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc)); |
1192 |
+ sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); |
1193 |
+- if (sctp_state(asoc, SHUTDOWN_PENDING) && |
1194 |
++ if ((sctp_state(asoc, SHUTDOWN_PENDING) || |
1195 |
++ sctp_state(asoc, SHUTDOWN_SENT)) && |
1196 |
+ (sctp_sstate(asoc->base.sk, CLOSING) || |
1197 |
+ sock_flag(asoc->base.sk, SOCK_DEAD))) { |
1198 |
+- /* if were currently in SHUTDOWN_PENDING, but the socket |
1199 |
+- * has been closed by user, don't transition to ESTABLISHED. |
1200 |
+- * Instead trigger SHUTDOWN bundled with COOKIE_ACK. |
1201 |
++ /* If the socket has been closed by user, don't |
1202 |
++ * transition to ESTABLISHED. Instead trigger SHUTDOWN |
1203 |
++ * bundled with COOKIE_ACK. |
1204 |
+ */ |
1205 |
+ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); |
1206 |
+ return sctp_sf_do_9_2_start_shutdown(net, ep, asoc, |
1207 |
+diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c |
1208 |
+index 6e3f0254d8a1..1e87639f2c27 100644 |
1209 |
+--- a/net/xfrm/xfrm_input.c |
1210 |
++++ b/net/xfrm/xfrm_input.c |
1211 |
+@@ -302,7 +302,7 @@ resume: |
1212 |
+ dev_put(skb->dev); |
1213 |
+ |
1214 |
+ spin_lock(&x->lock); |
1215 |
+- if (nexthdr <= 0) { |
1216 |
++ if (nexthdr < 0) { |
1217 |
+ if (nexthdr == -EBADMSG) { |
1218 |
+ xfrm_audit_state_icvfail(x, skb, |
1219 |
+ x->type->proto); |
1220 |
+diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c |
1221 |
+index ff4a91fcab9f..3e45e778404d 100644 |
1222 |
+--- a/net/xfrm/xfrm_output.c |
1223 |
++++ b/net/xfrm/xfrm_output.c |
1224 |
+@@ -237,7 +237,8 @@ void xfrm_local_error(struct sk_buff *skb, int mtu) |
1225 |
+ |
1226 |
+ if (skb->protocol == htons(ETH_P_IP)) |
1227 |
+ proto = AF_INET; |
1228 |
+- else if (skb->protocol == htons(ETH_P_IPV6)) |
1229 |
++ else if (skb->protocol == htons(ETH_P_IPV6) && |
1230 |
++ skb->sk->sk_family == AF_INET6) |
1231 |
+ proto = AF_INET6; |
1232 |
+ else |
1233 |
+ return; |
1234 |
+diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c |
1235 |
+index 3a33d0b98005..e62d4819089c 100644 |
1236 |
+--- a/net/xfrm/xfrm_policy.c |
1237 |
++++ b/net/xfrm/xfrm_policy.c |
1238 |
+@@ -740,12 +740,7 @@ static void xfrm_policy_requeue(struct xfrm_policy *old, |
1239 |
+ static bool xfrm_policy_mark_match(struct xfrm_policy *policy, |
1240 |
+ struct xfrm_policy *pol) |
1241 |
+ { |
1242 |
+- u32 mark = policy->mark.v & policy->mark.m; |
1243 |
+- |
1244 |
+- if (policy->mark.v == pol->mark.v && policy->mark.m == pol->mark.m) |
1245 |
+- return true; |
1246 |
+- |
1247 |
+- if ((mark & pol->mark.m) == pol->mark.v && |
1248 |
++ if (policy->mark.v == pol->mark.v && |
1249 |
+ policy->priority == pol->priority) |
1250 |
+ return true; |
1251 |
+ |
1252 |
+diff --git a/security/commoncap.c b/security/commoncap.c |
1253 |
+index 48071ed7c445..b62f97d83fd8 100644 |
1254 |
+--- a/security/commoncap.c |
1255 |
++++ b/security/commoncap.c |
1256 |
+@@ -494,6 +494,7 @@ int cap_bprm_set_creds(struct linux_binprm *bprm) |
1257 |
+ int ret; |
1258 |
+ kuid_t root_uid; |
1259 |
+ |
1260 |
++ new->cap_ambient = old->cap_ambient; |
1261 |
+ if (WARN_ON(!cap_ambient_invariant_ok(old))) |
1262 |
+ return -EPERM; |
1263 |
+ |
1264 |
+diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c |
1265 |
+index 36d2416f90d9..96b737adf4d2 100644 |
1266 |
+--- a/sound/core/hwdep.c |
1267 |
++++ b/sound/core/hwdep.c |
1268 |
+@@ -228,14 +228,14 @@ static int snd_hwdep_dsp_load(struct snd_hwdep *hw, |
1269 |
+ if (copy_from_user(&info, _info, sizeof(info))) |
1270 |
+ return -EFAULT; |
1271 |
+ /* check whether the dsp was already loaded */ |
1272 |
+- if (hw->dsp_loaded & (1 << info.index)) |
1273 |
++ if (hw->dsp_loaded & (1u << info.index)) |
1274 |
+ return -EBUSY; |
1275 |
+ if (!access_ok(VERIFY_READ, info.image, info.length)) |
1276 |
+ return -EFAULT; |
1277 |
+ err = hw->ops.dsp_load(hw, &info); |
1278 |
+ if (err < 0) |
1279 |
+ return err; |
1280 |
+- hw->dsp_loaded |= (1 << info.index); |
1281 |
++ hw->dsp_loaded |= (1u << info.index); |
1282 |
+ return 0; |
1283 |
+ } |
1284 |
+ |
1285 |
+diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c |
1286 |
+index f191f4a3cf3b..9bbe84ce7d07 100644 |
1287 |
+--- a/sound/usb/mixer.c |
1288 |
++++ b/sound/usb/mixer.c |
1289 |
+@@ -979,6 +979,14 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, |
1290 |
+ cval->res = 384; |
1291 |
+ } |
1292 |
+ break; |
1293 |
++ case USB_ID(0x0495, 0x3042): /* ESS Technology Asus USB DAC */ |
1294 |
++ if ((strstr(kctl->id.name, "Playback Volume") != NULL) || |
1295 |
++ strstr(kctl->id.name, "Capture Volume") != NULL) { |
1296 |
++ cval->min >>= 8; |
1297 |
++ cval->max = 0; |
1298 |
++ cval->res = 1; |
1299 |
++ } |
1300 |
++ break; |
1301 |
+ } |
1302 |
+ } |
1303 |
+ |