1 |
commit: a7614e16e5934261b1d377edad0f36a133adeb96 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 27 01:08:24 2017 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 27 01:08:24 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=a7614e16 |
7 |
|
8 |
Linux patch 4.10.1 |
9 |
|
10 |
0000_README | 4 + |
11 |
1000_linux-4.10.1.patch | 661 ++++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 665 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index 58e3c74..decfe62 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -43,6 +43,10 @@ EXPERIMENTAL |
19 |
Individual Patch Descriptions: |
20 |
-------------------------------------------------------------------------- |
21 |
|
22 |
+Patch: 1000_linux-4.10.1.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.10.1 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1000_linux-4.10.1.patch b/1000_linux-4.10.1.patch |
31 |
new file mode 100644 |
32 |
index 0000000..7b19ec2 |
33 |
--- /dev/null |
34 |
+++ b/1000_linux-4.10.1.patch |
35 |
@@ -0,0 +1,661 @@ |
36 |
+diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt |
37 |
+index be7c0d9506b1..18eefa860f76 100644 |
38 |
+--- a/Documentation/admin-guide/kernel-parameters.txt |
39 |
++++ b/Documentation/admin-guide/kernel-parameters.txt |
40 |
+@@ -1201,6 +1201,10 @@ |
41 |
+ When zero, profiling data is discarded and associated |
42 |
+ debugfs files are removed at module unload time. |
43 |
+ |
44 |
++ goldfish [X86] Enable the goldfish android emulator platform. |
45 |
++ Don't use this when you are not running on the |
46 |
++ android emulator |
47 |
++ |
48 |
+ gpt [EFI] Forces disk with valid GPT signature but |
49 |
+ invalid Protective MBR to be treated as GPT. If the |
50 |
+ primary GPT is corrupted, it enables the backup/alternate |
51 |
+diff --git a/Makefile b/Makefile |
52 |
+index f1e6a02a0c19..09eccff4f569 100644 |
53 |
+--- a/Makefile |
54 |
++++ b/Makefile |
55 |
+@@ -1,6 +1,6 @@ |
56 |
+ VERSION = 4 |
57 |
+ PATCHLEVEL = 10 |
58 |
+-SUBLEVEL = 0 |
59 |
++SUBLEVEL = 1 |
60 |
+ EXTRAVERSION = |
61 |
+ NAME = Fearless Coyote |
62 |
+ |
63 |
+diff --git a/arch/x86/platform/goldfish/goldfish.c b/arch/x86/platform/goldfish/goldfish.c |
64 |
+index 1693107a518e..0d17c0aafeb1 100644 |
65 |
+--- a/arch/x86/platform/goldfish/goldfish.c |
66 |
++++ b/arch/x86/platform/goldfish/goldfish.c |
67 |
+@@ -42,10 +42,22 @@ static struct resource goldfish_pdev_bus_resources[] = { |
68 |
+ } |
69 |
+ }; |
70 |
+ |
71 |
++static bool goldfish_enable __initdata; |
72 |
++ |
73 |
++static int __init goldfish_setup(char *str) |
74 |
++{ |
75 |
++ goldfish_enable = true; |
76 |
++ return 0; |
77 |
++} |
78 |
++__setup("goldfish", goldfish_setup); |
79 |
++ |
80 |
+ static int __init goldfish_init(void) |
81 |
+ { |
82 |
++ if (!goldfish_enable) |
83 |
++ return -ENODEV; |
84 |
++ |
85 |
+ platform_device_register_simple("goldfish_pdev_bus", -1, |
86 |
+- goldfish_pdev_bus_resources, 2); |
87 |
++ goldfish_pdev_bus_resources, 2); |
88 |
+ return 0; |
89 |
+ } |
90 |
+ device_initcall(goldfish_init); |
91 |
+diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c |
92 |
+index 49015b05f3d1..abdaf203835c 100644 |
93 |
+--- a/drivers/net/wireless/realtek/rtlwifi/usb.c |
94 |
++++ b/drivers/net/wireless/realtek/rtlwifi/usb.c |
95 |
+@@ -827,12 +827,30 @@ static void rtl_usb_stop(struct ieee80211_hw *hw) |
96 |
+ struct rtl_priv *rtlpriv = rtl_priv(hw); |
97 |
+ struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
98 |
+ struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); |
99 |
++ struct urb *urb; |
100 |
+ |
101 |
+ /* should after adapter start and interrupt enable. */ |
102 |
+ set_hal_stop(rtlhal); |
103 |
+ cancel_work_sync(&rtlpriv->works.fill_h2c_cmd); |
104 |
+ /* Enable software */ |
105 |
+ SET_USB_STOP(rtlusb); |
106 |
++ |
107 |
++ /* free pre-allocated URBs from rtl_usb_start() */ |
108 |
++ usb_kill_anchored_urbs(&rtlusb->rx_submitted); |
109 |
++ |
110 |
++ tasklet_kill(&rtlusb->rx_work_tasklet); |
111 |
++ cancel_work_sync(&rtlpriv->works.lps_change_work); |
112 |
++ |
113 |
++ flush_workqueue(rtlpriv->works.rtl_wq); |
114 |
++ |
115 |
++ skb_queue_purge(&rtlusb->rx_queue); |
116 |
++ |
117 |
++ while ((urb = usb_get_from_anchor(&rtlusb->rx_cleanup_urbs))) { |
118 |
++ usb_free_coherent(urb->dev, urb->transfer_buffer_length, |
119 |
++ urb->transfer_buffer, urb->transfer_dma); |
120 |
++ usb_free_urb(urb); |
121 |
++ } |
122 |
++ |
123 |
+ rtlpriv->cfg->ops->hw_disable(hw); |
124 |
+ } |
125 |
+ |
126 |
+diff --git a/drivers/platform/goldfish/pdev_bus.c b/drivers/platform/goldfish/pdev_bus.c |
127 |
+index 1f52462f4cdd..dd9ea463c2a4 100644 |
128 |
+--- a/drivers/platform/goldfish/pdev_bus.c |
129 |
++++ b/drivers/platform/goldfish/pdev_bus.c |
130 |
+@@ -157,23 +157,26 @@ static int goldfish_new_pdev(void) |
131 |
+ static irqreturn_t goldfish_pdev_bus_interrupt(int irq, void *dev_id) |
132 |
+ { |
133 |
+ irqreturn_t ret = IRQ_NONE; |
134 |
++ |
135 |
+ while (1) { |
136 |
+ u32 op = readl(pdev_bus_base + PDEV_BUS_OP); |
137 |
+- switch (op) { |
138 |
+- case PDEV_BUS_OP_DONE: |
139 |
+- return IRQ_NONE; |
140 |
+ |
141 |
++ switch (op) { |
142 |
+ case PDEV_BUS_OP_REMOVE_DEV: |
143 |
+ goldfish_pdev_remove(); |
144 |
++ ret = IRQ_HANDLED; |
145 |
+ break; |
146 |
+ |
147 |
+ case PDEV_BUS_OP_ADD_DEV: |
148 |
+ goldfish_new_pdev(); |
149 |
++ ret = IRQ_HANDLED; |
150 |
+ break; |
151 |
++ |
152 |
++ case PDEV_BUS_OP_DONE: |
153 |
++ default: |
154 |
++ return ret; |
155 |
+ } |
156 |
+- ret = IRQ_HANDLED; |
157 |
+ } |
158 |
+- return ret; |
159 |
+ } |
160 |
+ |
161 |
+ static int goldfish_pdev_bus_probe(struct platform_device *pdev) |
162 |
+diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c |
163 |
+index 7312e7e01b7e..6788e7532dff 100644 |
164 |
+--- a/drivers/tty/serial/msm_serial.c |
165 |
++++ b/drivers/tty/serial/msm_serial.c |
166 |
+@@ -1809,6 +1809,7 @@ static const struct of_device_id msm_match_table[] = { |
167 |
+ { .compatible = "qcom,msm-uartdm" }, |
168 |
+ {} |
169 |
+ }; |
170 |
++MODULE_DEVICE_TABLE(of, msm_match_table); |
171 |
+ |
172 |
+ static struct platform_driver msm_platform_driver = { |
173 |
+ .remove = msm_serial_remove, |
174 |
+diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c |
175 |
+index 1532cde8a437..7812052dc700 100644 |
176 |
+--- a/drivers/usb/serial/ark3116.c |
177 |
++++ b/drivers/usb/serial/ark3116.c |
178 |
+@@ -99,10 +99,17 @@ static int ark3116_read_reg(struct usb_serial *serial, |
179 |
+ usb_rcvctrlpipe(serial->dev, 0), |
180 |
+ 0xfe, 0xc0, 0, reg, |
181 |
+ buf, 1, ARK_TIMEOUT); |
182 |
+- if (result < 0) |
183 |
++ if (result < 1) { |
184 |
++ dev_err(&serial->interface->dev, |
185 |
++ "failed to read register %u: %d\n", |
186 |
++ reg, result); |
187 |
++ if (result >= 0) |
188 |
++ result = -EIO; |
189 |
++ |
190 |
+ return result; |
191 |
+- else |
192 |
+- return buf[0]; |
193 |
++ } |
194 |
++ |
195 |
++ return buf[0]; |
196 |
+ } |
197 |
+ |
198 |
+ static inline int calc_divisor(int bps) |
199 |
+diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c |
200 |
+index 8967715fe6fc..b6f1adefb758 100644 |
201 |
+--- a/drivers/usb/serial/console.c |
202 |
++++ b/drivers/usb/serial/console.c |
203 |
+@@ -143,6 +143,7 @@ static int usb_console_setup(struct console *co, char *options) |
204 |
+ tty->driver = usb_serial_tty_driver; |
205 |
+ tty->index = co->index; |
206 |
+ init_ldsem(&tty->ldisc_sem); |
207 |
++ spin_lock_init(&tty->files_lock); |
208 |
+ INIT_LIST_HEAD(&tty->tty_files); |
209 |
+ kref_get(&tty->driver->kref); |
210 |
+ __module_get(tty->driver->owner); |
211 |
+diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c |
212 |
+index fff718352e0c..fbe69465eefa 100644 |
213 |
+--- a/drivers/usb/serial/cp210x.c |
214 |
++++ b/drivers/usb/serial/cp210x.c |
215 |
+@@ -178,6 +178,8 @@ static const struct usb_device_id id_table[] = { |
216 |
+ { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ |
217 |
+ { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ |
218 |
+ { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ |
219 |
++ { USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */ |
220 |
++ { USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */ |
221 |
+ { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ |
222 |
+ { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ |
223 |
+ { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ |
224 |
+diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c |
225 |
+index 23d14b98ae2a..7d863fda1f18 100644 |
226 |
+--- a/drivers/usb/serial/ftdi_sio.c |
227 |
++++ b/drivers/usb/serial/ftdi_sio.c |
228 |
+@@ -1802,8 +1802,6 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port) |
229 |
+ |
230 |
+ mutex_init(&priv->cfg_lock); |
231 |
+ |
232 |
+- priv->flags = ASYNC_LOW_LATENCY; |
233 |
+- |
234 |
+ if (quirk && quirk->port_probe) |
235 |
+ quirk->port_probe(priv); |
236 |
+ |
237 |
+@@ -2067,6 +2065,20 @@ static int ftdi_process_packet(struct usb_serial_port *port, |
238 |
+ priv->prev_status = status; |
239 |
+ } |
240 |
+ |
241 |
++ /* save if the transmitter is empty or not */ |
242 |
++ if (packet[1] & FTDI_RS_TEMT) |
243 |
++ priv->transmit_empty = 1; |
244 |
++ else |
245 |
++ priv->transmit_empty = 0; |
246 |
++ |
247 |
++ len -= 2; |
248 |
++ if (!len) |
249 |
++ return 0; /* status only */ |
250 |
++ |
251 |
++ /* |
252 |
++ * Break and error status must only be processed for packets with |
253 |
++ * data payload to avoid over-reporting. |
254 |
++ */ |
255 |
+ flag = TTY_NORMAL; |
256 |
+ if (packet[1] & FTDI_RS_ERR_MASK) { |
257 |
+ /* Break takes precedence over parity, which takes precedence |
258 |
+@@ -2089,15 +2101,6 @@ static int ftdi_process_packet(struct usb_serial_port *port, |
259 |
+ } |
260 |
+ } |
261 |
+ |
262 |
+- /* save if the transmitter is empty or not */ |
263 |
+- if (packet[1] & FTDI_RS_TEMT) |
264 |
+- priv->transmit_empty = 1; |
265 |
+- else |
266 |
+- priv->transmit_empty = 0; |
267 |
+- |
268 |
+- len -= 2; |
269 |
+- if (!len) |
270 |
+- return 0; /* status only */ |
271 |
+ port->icount.rx += len; |
272 |
+ ch = packet + 2; |
273 |
+ |
274 |
+@@ -2428,8 +2431,12 @@ static int ftdi_get_modem_status(struct usb_serial_port *port, |
275 |
+ FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, |
276 |
+ 0, priv->interface, |
277 |
+ buf, len, WDR_TIMEOUT); |
278 |
+- if (ret < 0) { |
279 |
++ |
280 |
++ /* NOTE: We allow short responses and handle that below. */ |
281 |
++ if (ret < 1) { |
282 |
+ dev_err(&port->dev, "failed to get modem status: %d\n", ret); |
283 |
++ if (ret >= 0) |
284 |
++ ret = -EIO; |
285 |
+ ret = usb_translate_errors(ret); |
286 |
+ goto out; |
287 |
+ } |
288 |
+diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c |
289 |
+index ea27fb23967a..e536ac8a080b 100644 |
290 |
+--- a/drivers/usb/serial/mos7840.c |
291 |
++++ b/drivers/usb/serial/mos7840.c |
292 |
+@@ -1023,6 +1023,7 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port) |
293 |
+ * (can't set it up in mos7840_startup as the structures * |
294 |
+ * were not set up at that time.) */ |
295 |
+ if (port0->open_ports == 1) { |
296 |
++ /* FIXME: Buffer never NULL, so URB is not submitted. */ |
297 |
+ if (serial->port[0]->interrupt_in_buffer == NULL) { |
298 |
+ /* set up interrupt urb */ |
299 |
+ usb_fill_int_urb(serial->port[0]->interrupt_in_urb, |
300 |
+@@ -2106,7 +2107,8 @@ static int mos7840_calc_num_ports(struct usb_serial *serial) |
301 |
+ static int mos7840_attach(struct usb_serial *serial) |
302 |
+ { |
303 |
+ if (serial->num_bulk_in < serial->num_ports || |
304 |
+- serial->num_bulk_out < serial->num_ports) { |
305 |
++ serial->num_bulk_out < serial->num_ports || |
306 |
++ serial->num_interrupt_in < 1) { |
307 |
+ dev_err(&serial->interface->dev, "missing endpoints\n"); |
308 |
+ return -ENODEV; |
309 |
+ } |
310 |
+diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c |
311 |
+index 5ded6f524d59..b3c64f557d60 100644 |
312 |
+--- a/drivers/usb/serial/opticon.c |
313 |
++++ b/drivers/usb/serial/opticon.c |
314 |
+@@ -142,7 +142,7 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port) |
315 |
+ usb_clear_halt(port->serial->dev, port->read_urb->pipe); |
316 |
+ |
317 |
+ res = usb_serial_generic_open(tty, port); |
318 |
+- if (!res) |
319 |
++ if (res) |
320 |
+ return res; |
321 |
+ |
322 |
+ /* Request CTS line state, sometimes during opening the current |
323 |
+diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c |
324 |
+index 475e6c31b266..ddfd787c461c 100644 |
325 |
+--- a/drivers/usb/serial/spcp8x5.c |
326 |
++++ b/drivers/usb/serial/spcp8x5.c |
327 |
+@@ -232,11 +232,17 @@ static int spcp8x5_get_msr(struct usb_serial_port *port, u8 *status) |
328 |
+ ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), |
329 |
+ GET_UART_STATUS, GET_UART_STATUS_TYPE, |
330 |
+ 0, GET_UART_STATUS_MSR, buf, 1, 100); |
331 |
+- if (ret < 0) |
332 |
++ if (ret < 1) { |
333 |
+ dev_err(&port->dev, "failed to get modem status: %d\n", ret); |
334 |
++ if (ret >= 0) |
335 |
++ ret = -EIO; |
336 |
++ goto out; |
337 |
++ } |
338 |
+ |
339 |
+ dev_dbg(&port->dev, "0xc0:0x22:0:6 %d - 0x02%x\n", ret, *buf); |
340 |
+ *status = *buf; |
341 |
++ ret = 0; |
342 |
++out: |
343 |
+ kfree(buf); |
344 |
+ |
345 |
+ return ret; |
346 |
+diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c |
347 |
+index 1aa3abd67b36..fdecf79d2fa4 100644 |
348 |
+--- a/fs/xfs/xfs_iomap.c |
349 |
++++ b/fs/xfs/xfs_iomap.c |
350 |
+@@ -1102,7 +1102,15 @@ xfs_file_iomap_end_delalloc( |
351 |
+ xfs_fileoff_t end_fsb; |
352 |
+ int error = 0; |
353 |
+ |
354 |
+- start_fsb = XFS_B_TO_FSB(mp, offset + written); |
355 |
++ /* |
356 |
++ * start_fsb refers to the first unused block after a short write. If |
357 |
++ * nothing was written, round offset down to point at the first block in |
358 |
++ * the range. |
359 |
++ */ |
360 |
++ if (unlikely(!written)) |
361 |
++ start_fsb = XFS_B_TO_FSBT(mp, offset); |
362 |
++ else |
363 |
++ start_fsb = XFS_B_TO_FSB(mp, offset + written); |
364 |
+ end_fsb = XFS_B_TO_FSB(mp, offset + length); |
365 |
+ |
366 |
+ /* |
367 |
+@@ -1114,6 +1122,9 @@ xfs_file_iomap_end_delalloc( |
368 |
+ * blocks in the range, they are ours. |
369 |
+ */ |
370 |
+ if (start_fsb < end_fsb) { |
371 |
++ truncate_pagecache_range(VFS_I(ip), XFS_FSB_TO_B(mp, start_fsb), |
372 |
++ XFS_FSB_TO_B(mp, end_fsb) - 1); |
373 |
++ |
374 |
+ xfs_ilock(ip, XFS_ILOCK_EXCL); |
375 |
+ error = xfs_bmap_punch_delalloc_range(ip, start_fsb, |
376 |
+ end_fsb - start_fsb); |
377 |
+diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h |
378 |
+index 34cce729109c..fca15390a42c 100644 |
379 |
+--- a/include/acpi/platform/acenv.h |
380 |
++++ b/include/acpi/platform/acenv.h |
381 |
+@@ -177,7 +177,7 @@ |
382 |
+ #include "acmsvc.h" |
383 |
+ |
384 |
+ #elif defined(__INTEL_COMPILER) |
385 |
+-#include "acintel.h" |
386 |
++#include <acpi/platform/acintel.h> |
387 |
+ |
388 |
+ #endif |
389 |
+ |
390 |
+diff --git a/include/acpi/platform/acintel.h b/include/acpi/platform/acintel.h |
391 |
+new file mode 100644 |
392 |
+index 000000000000..17bd3b7b4e5a |
393 |
+--- /dev/null |
394 |
++++ b/include/acpi/platform/acintel.h |
395 |
+@@ -0,0 +1,87 @@ |
396 |
++/****************************************************************************** |
397 |
++ * |
398 |
++ * Name: acintel.h - VC specific defines, etc. |
399 |
++ * |
400 |
++ *****************************************************************************/ |
401 |
++ |
402 |
++/* |
403 |
++ * Copyright (C) 2000 - 2017, Intel Corp. |
404 |
++ * All rights reserved. |
405 |
++ * |
406 |
++ * Redistribution and use in source and binary forms, with or without |
407 |
++ * modification, are permitted provided that the following conditions |
408 |
++ * are met: |
409 |
++ * 1. Redistributions of source code must retain the above copyright |
410 |
++ * notice, this list of conditions, and the following disclaimer, |
411 |
++ * without modification. |
412 |
++ * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
413 |
++ * substantially similar to the "NO WARRANTY" disclaimer below |
414 |
++ * ("Disclaimer") and any redistribution must be conditioned upon |
415 |
++ * including a substantially similar Disclaimer requirement for further |
416 |
++ * binary redistribution. |
417 |
++ * 3. Neither the names of the above-listed copyright holders nor the names |
418 |
++ * of any contributors may be used to endorse or promote products derived |
419 |
++ * from this software without specific prior written permission. |
420 |
++ * |
421 |
++ * Alternatively, this software may be distributed under the terms of the |
422 |
++ * GNU General Public License ("GPL") version 2 as published by the Free |
423 |
++ * Software Foundation. |
424 |
++ * |
425 |
++ * NO WARRANTY |
426 |
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
427 |
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
428 |
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
429 |
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
430 |
++ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
431 |
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
432 |
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
433 |
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
434 |
++ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
435 |
++ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
436 |
++ * POSSIBILITY OF SUCH DAMAGES. |
437 |
++ */ |
438 |
++ |
439 |
++#ifndef __ACINTEL_H__ |
440 |
++#define __ACINTEL_H__ |
441 |
++ |
442 |
++/* |
443 |
++ * Use compiler specific <stdarg.h> is a good practice for even when |
444 |
++ * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined. |
445 |
++ */ |
446 |
++#include <stdarg.h> |
447 |
++ |
448 |
++/* Configuration specific to Intel 64-bit C compiler */ |
449 |
++ |
450 |
++#define COMPILER_DEPENDENT_INT64 __int64 |
451 |
++#define COMPILER_DEPENDENT_UINT64 unsigned __int64 |
452 |
++#define ACPI_INLINE __inline |
453 |
++ |
454 |
++/* |
455 |
++ * Calling conventions: |
456 |
++ * |
457 |
++ * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) |
458 |
++ * ACPI_EXTERNAL_XFACE - External ACPI interfaces |
459 |
++ * ACPI_INTERNAL_XFACE - Internal ACPI interfaces |
460 |
++ * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces |
461 |
++ */ |
462 |
++#define ACPI_SYSTEM_XFACE |
463 |
++#define ACPI_EXTERNAL_XFACE |
464 |
++#define ACPI_INTERNAL_XFACE |
465 |
++#define ACPI_INTERNAL_VAR_XFACE |
466 |
++ |
467 |
++/* remark 981 - operands evaluated in no particular order */ |
468 |
++#pragma warning(disable:981) |
469 |
++ |
470 |
++/* warn C4100: unreferenced formal parameter */ |
471 |
++#pragma warning(disable:4100) |
472 |
++ |
473 |
++/* warn C4127: conditional expression is constant */ |
474 |
++#pragma warning(disable:4127) |
475 |
++ |
476 |
++/* warn C4706: assignment within conditional expression */ |
477 |
++#pragma warning(disable:4706) |
478 |
++ |
479 |
++/* warn C4214: bit field types other than int */ |
480 |
++#pragma warning(disable:4214) |
481 |
++ |
482 |
++#endif /* __ACINTEL_H__ */ |
483 |
+diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h |
484 |
+index 2052011bf9fb..6c70444da3b9 100644 |
485 |
+--- a/include/linux/ptr_ring.h |
486 |
++++ b/include/linux/ptr_ring.h |
487 |
+@@ -111,6 +111,11 @@ static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr) |
488 |
+ return 0; |
489 |
+ } |
490 |
+ |
491 |
++/* |
492 |
++ * Note: resize (below) nests producer lock within consumer lock, so if you |
493 |
++ * consume in interrupt or BH context, you must disable interrupts/BH when |
494 |
++ * calling this. |
495 |
++ */ |
496 |
+ static inline int ptr_ring_produce(struct ptr_ring *r, void *ptr) |
497 |
+ { |
498 |
+ int ret; |
499 |
+@@ -242,6 +247,11 @@ static inline void *__ptr_ring_consume(struct ptr_ring *r) |
500 |
+ return ptr; |
501 |
+ } |
502 |
+ |
503 |
++/* |
504 |
++ * Note: resize (below) nests producer lock within consumer lock, so if you |
505 |
++ * call this in interrupt or BH context, you must disable interrupts/BH when |
506 |
++ * producing. |
507 |
++ */ |
508 |
+ static inline void *ptr_ring_consume(struct ptr_ring *r) |
509 |
+ { |
510 |
+ void *ptr; |
511 |
+@@ -357,7 +367,7 @@ static inline void **__ptr_ring_swap_queue(struct ptr_ring *r, void **queue, |
512 |
+ void **old; |
513 |
+ void *ptr; |
514 |
+ |
515 |
+- while ((ptr = ptr_ring_consume(r))) |
516 |
++ while ((ptr = __ptr_ring_consume(r))) |
517 |
+ if (producer < size) |
518 |
+ queue[producer++] = ptr; |
519 |
+ else if (destroy) |
520 |
+@@ -372,6 +382,12 @@ static inline void **__ptr_ring_swap_queue(struct ptr_ring *r, void **queue, |
521 |
+ return old; |
522 |
+ } |
523 |
+ |
524 |
++/* |
525 |
++ * Note: producer lock is nested within consumer lock, so if you |
526 |
++ * resize you must make sure all uses nest correctly. |
527 |
++ * In particular if you consume ring in interrupt or BH context, you must |
528 |
++ * disable interrupts/BH when doing so. |
529 |
++ */ |
530 |
+ static inline int ptr_ring_resize(struct ptr_ring *r, int size, gfp_t gfp, |
531 |
+ void (*destroy)(void *)) |
532 |
+ { |
533 |
+@@ -382,17 +398,25 @@ static inline int ptr_ring_resize(struct ptr_ring *r, int size, gfp_t gfp, |
534 |
+ if (!queue) |
535 |
+ return -ENOMEM; |
536 |
+ |
537 |
+- spin_lock_irqsave(&(r)->producer_lock, flags); |
538 |
++ spin_lock_irqsave(&(r)->consumer_lock, flags); |
539 |
++ spin_lock(&(r)->producer_lock); |
540 |
+ |
541 |
+ old = __ptr_ring_swap_queue(r, queue, size, gfp, destroy); |
542 |
+ |
543 |
+- spin_unlock_irqrestore(&(r)->producer_lock, flags); |
544 |
++ spin_unlock(&(r)->producer_lock); |
545 |
++ spin_unlock_irqrestore(&(r)->consumer_lock, flags); |
546 |
+ |
547 |
+ kfree(old); |
548 |
+ |
549 |
+ return 0; |
550 |
+ } |
551 |
+ |
552 |
++/* |
553 |
++ * Note: producer lock is nested within consumer lock, so if you |
554 |
++ * resize you must make sure all uses nest correctly. |
555 |
++ * In particular if you consume ring in interrupt or BH context, you must |
556 |
++ * disable interrupts/BH when doing so. |
557 |
++ */ |
558 |
+ static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, int nrings, |
559 |
+ int size, |
560 |
+ gfp_t gfp, void (*destroy)(void *)) |
561 |
+@@ -412,10 +436,12 @@ static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, int nrings, |
562 |
+ } |
563 |
+ |
564 |
+ for (i = 0; i < nrings; ++i) { |
565 |
+- spin_lock_irqsave(&(rings[i])->producer_lock, flags); |
566 |
++ spin_lock_irqsave(&(rings[i])->consumer_lock, flags); |
567 |
++ spin_lock(&(rings[i])->producer_lock); |
568 |
+ queues[i] = __ptr_ring_swap_queue(rings[i], queues[i], |
569 |
+ size, gfp, destroy); |
570 |
+- spin_unlock_irqrestore(&(rings[i])->producer_lock, flags); |
571 |
++ spin_unlock(&(rings[i])->producer_lock); |
572 |
++ spin_unlock_irqrestore(&(rings[i])->consumer_lock, flags); |
573 |
+ } |
574 |
+ |
575 |
+ for (i = 0; i < nrings; ++i) |
576 |
+diff --git a/mm/backing-dev.c b/mm/backing-dev.c |
577 |
+index 3bfed5ab2475..61b34071e3ee 100644 |
578 |
+--- a/mm/backing-dev.c |
579 |
++++ b/mm/backing-dev.c |
580 |
+@@ -758,15 +758,20 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) |
581 |
+ if (!bdi->wb_congested) |
582 |
+ return -ENOMEM; |
583 |
+ |
584 |
++ atomic_set(&bdi->wb_congested->refcnt, 1); |
585 |
++ |
586 |
+ err = wb_init(&bdi->wb, bdi, 1, GFP_KERNEL); |
587 |
+ if (err) { |
588 |
+- kfree(bdi->wb_congested); |
589 |
++ wb_congested_put(bdi->wb_congested); |
590 |
+ return err; |
591 |
+ } |
592 |
+ return 0; |
593 |
+ } |
594 |
+ |
595 |
+-static void cgwb_bdi_destroy(struct backing_dev_info *bdi) { } |
596 |
++static void cgwb_bdi_destroy(struct backing_dev_info *bdi) |
597 |
++{ |
598 |
++ wb_congested_put(bdi->wb_congested); |
599 |
++} |
600 |
+ |
601 |
+ #endif /* CONFIG_CGROUP_WRITEBACK */ |
602 |
+ |
603 |
+diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c |
604 |
+index 900011709e3b..fc4bf4d54158 100644 |
605 |
+--- a/net/ipv4/ip_sockglue.c |
606 |
++++ b/net/ipv4/ip_sockglue.c |
607 |
+@@ -116,10 +116,10 @@ static void ip_cmsg_recv_checksum(struct msghdr *msg, struct sk_buff *skb, |
608 |
+ if (skb->ip_summed != CHECKSUM_COMPLETE) |
609 |
+ return; |
610 |
+ |
611 |
+- if (offset != 0) |
612 |
+- csum = csum_sub(csum, |
613 |
+- csum_partial(skb_transport_header(skb) + tlen, |
614 |
+- offset, 0)); |
615 |
++ if (offset != 0) { |
616 |
++ int tend_off = skb_transport_offset(skb) + tlen; |
617 |
++ csum = csum_sub(csum, skb_checksum(skb, tend_off, offset, 0)); |
618 |
++ } |
619 |
+ |
620 |
+ put_cmsg(msg, SOL_IP, IP_CHECKSUM, sizeof(__wsum), &csum); |
621 |
+ } |
622 |
+diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c |
623 |
+index 7341adf7059d..6dc44d9b4190 100644 |
624 |
+--- a/net/netfilter/nf_conntrack_helper.c |
625 |
++++ b/net/netfilter/nf_conntrack_helper.c |
626 |
+@@ -188,6 +188,26 @@ nf_ct_helper_ext_add(struct nf_conn *ct, |
627 |
+ } |
628 |
+ EXPORT_SYMBOL_GPL(nf_ct_helper_ext_add); |
629 |
+ |
630 |
++static struct nf_conntrack_helper * |
631 |
++nf_ct_lookup_helper(struct nf_conn *ct, struct net *net) |
632 |
++{ |
633 |
++ if (!net->ct.sysctl_auto_assign_helper) { |
634 |
++ if (net->ct.auto_assign_helper_warned) |
635 |
++ return NULL; |
636 |
++ if (!__nf_ct_helper_find(&ct->tuplehash[IP_CT_DIR_REPLY].tuple)) |
637 |
++ return NULL; |
638 |
++ pr_info("nf_conntrack: default automatic helper assignment " |
639 |
++ "has been turned off for security reasons and CT-based " |
640 |
++ " firewall rule not found. Use the iptables CT target " |
641 |
++ "to attach helpers instead.\n"); |
642 |
++ net->ct.auto_assign_helper_warned = 1; |
643 |
++ return NULL; |
644 |
++ } |
645 |
++ |
646 |
++ return __nf_ct_helper_find(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); |
647 |
++} |
648 |
++ |
649 |
++ |
650 |
+ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, |
651 |
+ gfp_t flags) |
652 |
+ { |
653 |
+@@ -213,21 +233,14 @@ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, |
654 |
+ } |
655 |
+ |
656 |
+ help = nfct_help(ct); |
657 |
+- if (net->ct.sysctl_auto_assign_helper && helper == NULL) { |
658 |
+- helper = __nf_ct_helper_find(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); |
659 |
+- if (unlikely(!net->ct.auto_assign_helper_warned && helper)) { |
660 |
+- pr_info("nf_conntrack: automatic helper " |
661 |
+- "assignment is deprecated and it will " |
662 |
+- "be removed soon. Use the iptables CT target " |
663 |
+- "to attach helpers instead.\n"); |
664 |
+- net->ct.auto_assign_helper_warned = true; |
665 |
+- } |
666 |
+- } |
667 |
+ |
668 |
+ if (helper == NULL) { |
669 |
+- if (help) |
670 |
+- RCU_INIT_POINTER(help->helper, NULL); |
671 |
+- return 0; |
672 |
++ helper = nf_ct_lookup_helper(ct, net); |
673 |
++ if (helper == NULL) { |
674 |
++ if (help) |
675 |
++ RCU_INIT_POINTER(help->helper, NULL); |
676 |
++ return 0; |
677 |
++ } |
678 |
+ } |
679 |
+ |
680 |
+ if (help == NULL) { |
681 |
+diff --git a/net/socket.c b/net/socket.c |
682 |
+index 0758e13754e2..02bd9249e295 100644 |
683 |
+--- a/net/socket.c |
684 |
++++ b/net/socket.c |
685 |
+@@ -2228,8 +2228,10 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, |
686 |
+ return err; |
687 |
+ |
688 |
+ err = sock_error(sock->sk); |
689 |
+- if (err) |
690 |
++ if (err) { |
691 |
++ datagrams = err; |
692 |
+ goto out_put; |
693 |
++ } |
694 |
+ |
695 |
+ entry = mmsg; |
696 |
+ compat_entry = (struct compat_mmsghdr __user *)mmsg; |