1 |
commit: 592f737461319b089a399314f5b6b1521870db8a |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 29 18:50:58 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 29 18:50:58 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=592f7374 |
7 |
|
8 |
proj/linux-patches: Linux patch 4.9.148 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1147_linux-4.9.148.patch | 588 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 592 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 45d73b5..490672d 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -631,6 +631,10 @@ Patch: 1146_linux-4.9.147.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.9.147 |
23 |
|
24 |
+Patch: 1147_linux-4.9.148.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.9.148 |
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/1147_linux-4.9.148.patch b/1147_linux-4.9.148.patch |
33 |
new file mode 100644 |
34 |
index 0000000..de7316c |
35 |
--- /dev/null |
36 |
+++ b/1147_linux-4.9.148.patch |
37 |
@@ -0,0 +1,588 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 3cccc51a57ce..1b71b11ea63e 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 9 |
45 |
+-SUBLEVEL = 147 |
46 |
++SUBLEVEL = 148 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Roaring Lionus |
49 |
+ |
50 |
+diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c |
51 |
+index 6d9b45549109..d5b2a08e2b66 100644 |
52 |
+--- a/arch/x86/kernel/cpu/mtrr/if.c |
53 |
++++ b/arch/x86/kernel/cpu/mtrr/if.c |
54 |
+@@ -172,6 +172,8 @@ mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg) |
55 |
+ struct mtrr_gentry gentry; |
56 |
+ void __user *arg = (void __user *) __arg; |
57 |
+ |
58 |
++ memset(&gentry, 0, sizeof(gentry)); |
59 |
++ |
60 |
+ switch (cmd) { |
61 |
+ case MTRRIOC_ADD_ENTRY: |
62 |
+ case MTRRIOC_SET_ENTRY: |
63 |
+diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c |
64 |
+index ae52ef05d098..769831d9fd11 100644 |
65 |
+--- a/arch/x86/kernel/fpu/signal.c |
66 |
++++ b/arch/x86/kernel/fpu/signal.c |
67 |
+@@ -342,10 +342,10 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size) |
68 |
+ sanitize_restored_xstate(tsk, &env, xfeatures, fx_only); |
69 |
+ } |
70 |
+ |
71 |
++ local_bh_disable(); |
72 |
+ fpu->fpstate_active = 1; |
73 |
+- preempt_disable(); |
74 |
+ fpu__restore(fpu); |
75 |
+- preempt_enable(); |
76 |
++ local_bh_enable(); |
77 |
+ |
78 |
+ return err; |
79 |
+ } else { |
80 |
+diff --git a/block/blk-lib.c b/block/blk-lib.c |
81 |
+index 46fe9248410d..af1d26f79878 100644 |
82 |
+--- a/block/blk-lib.c |
83 |
++++ b/block/blk-lib.c |
84 |
+@@ -63,10 +63,18 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, |
85 |
+ unsigned int req_sects; |
86 |
+ sector_t end_sect, tmp; |
87 |
+ |
88 |
+- /* Make sure bi_size doesn't overflow */ |
89 |
+- req_sects = min_t(sector_t, nr_sects, UINT_MAX >> 9); |
90 |
++ /* |
91 |
++ * Issue in chunks of the user defined max discard setting, |
92 |
++ * ensuring that bi_size doesn't overflow |
93 |
++ */ |
94 |
++ req_sects = min_t(sector_t, nr_sects, |
95 |
++ q->limits.max_discard_sectors); |
96 |
++ if (!req_sects) |
97 |
++ goto fail; |
98 |
++ if (req_sects > UINT_MAX >> 9) |
99 |
++ req_sects = UINT_MAX >> 9; |
100 |
+ |
101 |
+- /** |
102 |
++ /* |
103 |
+ * If splitting a request, and the next starting sector would be |
104 |
+ * misaligned, stop the discard at the previous aligned sector. |
105 |
+ */ |
106 |
+@@ -100,6 +108,14 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, |
107 |
+ |
108 |
+ *biop = bio; |
109 |
+ return 0; |
110 |
++ |
111 |
++fail: |
112 |
++ if (bio) { |
113 |
++ submit_bio_wait(bio); |
114 |
++ bio_put(bio); |
115 |
++ } |
116 |
++ *biop = NULL; |
117 |
++ return -EOPNOTSUPP; |
118 |
+ } |
119 |
+ EXPORT_SYMBOL(__blkdev_issue_discard); |
120 |
+ |
121 |
+diff --git a/drivers/gpio/gpio-max7301.c b/drivers/gpio/gpio-max7301.c |
122 |
+index 05813fbf3daf..647dfbbc4e1c 100644 |
123 |
+--- a/drivers/gpio/gpio-max7301.c |
124 |
++++ b/drivers/gpio/gpio-max7301.c |
125 |
+@@ -25,7 +25,7 @@ static int max7301_spi_write(struct device *dev, unsigned int reg, |
126 |
+ struct spi_device *spi = to_spi_device(dev); |
127 |
+ u16 word = ((reg & 0x7F) << 8) | (val & 0xFF); |
128 |
+ |
129 |
+- return spi_write(spi, (const u8 *)&word, sizeof(word)); |
130 |
++ return spi_write_then_read(spi, &word, sizeof(word), NULL, 0); |
131 |
+ } |
132 |
+ |
133 |
+ /* A read from the MAX7301 means two transfers; here, one message each */ |
134 |
+@@ -37,14 +37,8 @@ static int max7301_spi_read(struct device *dev, unsigned int reg) |
135 |
+ struct spi_device *spi = to_spi_device(dev); |
136 |
+ |
137 |
+ word = 0x8000 | (reg << 8); |
138 |
+- ret = spi_write(spi, (const u8 *)&word, sizeof(word)); |
139 |
+- if (ret) |
140 |
+- return ret; |
141 |
+- /* |
142 |
+- * This relies on the fact, that a transfer with NULL tx_buf shifts out |
143 |
+- * zero bytes (=NOOP for MAX7301) |
144 |
+- */ |
145 |
+- ret = spi_read(spi, (u8 *)&word, sizeof(word)); |
146 |
++ ret = spi_write_then_read(spi, &word, sizeof(word), &word, |
147 |
++ sizeof(word)); |
148 |
+ if (ret) |
149 |
+ return ret; |
150 |
+ return word & 0xff; |
151 |
+diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c |
152 |
+index 71c3473476c7..04b26ca06180 100644 |
153 |
+--- a/drivers/gpu/drm/drm_ioctl.c |
154 |
++++ b/drivers/gpu/drm/drm_ioctl.c |
155 |
+@@ -36,6 +36,7 @@ |
156 |
+ |
157 |
+ #include <linux/pci.h> |
158 |
+ #include <linux/export.h> |
159 |
++#include <linux/nospec.h> |
160 |
+ |
161 |
+ /** |
162 |
+ * DOC: getunique and setversion story |
163 |
+@@ -668,13 +669,17 @@ long drm_ioctl(struct file *filp, |
164 |
+ |
165 |
+ if (is_driver_ioctl) { |
166 |
+ /* driver ioctl */ |
167 |
+- if (nr - DRM_COMMAND_BASE >= dev->driver->num_ioctls) |
168 |
++ unsigned int index = nr - DRM_COMMAND_BASE; |
169 |
++ |
170 |
++ if (index >= dev->driver->num_ioctls) |
171 |
+ goto err_i1; |
172 |
+- ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; |
173 |
++ index = array_index_nospec(index, dev->driver->num_ioctls); |
174 |
++ ioctl = &dev->driver->ioctls[index]; |
175 |
+ } else { |
176 |
+ /* core ioctl */ |
177 |
+ if (nr >= DRM_CORE_IOCTL_COUNT) |
178 |
+ goto err_i1; |
179 |
++ nr = array_index_nospec(nr, DRM_CORE_IOCTL_COUNT); |
180 |
+ ioctl = &drm_ioctls[nr]; |
181 |
+ } |
182 |
+ |
183 |
+@@ -770,6 +775,7 @@ bool drm_ioctl_flags(unsigned int nr, unsigned int *flags) |
184 |
+ |
185 |
+ if (nr >= DRM_CORE_IOCTL_COUNT) |
186 |
+ return false; |
187 |
++ nr = array_index_nospec(nr, DRM_CORE_IOCTL_COUNT); |
188 |
+ |
189 |
+ *flags = drm_ioctls[nr].flags; |
190 |
+ return true; |
191 |
+diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c |
192 |
+index 0276d2ef06ee..9a0d0d0ad6d0 100644 |
193 |
+--- a/drivers/hv/vmbus_drv.c |
194 |
++++ b/drivers/hv/vmbus_drv.c |
195 |
+@@ -317,6 +317,8 @@ static ssize_t out_intr_mask_show(struct device *dev, |
196 |
+ |
197 |
+ if (!hv_dev->channel) |
198 |
+ return -ENODEV; |
199 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
200 |
++ return -EINVAL; |
201 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); |
202 |
+ return sprintf(buf, "%d\n", outbound.current_interrupt_mask); |
203 |
+ } |
204 |
+@@ -330,6 +332,8 @@ static ssize_t out_read_index_show(struct device *dev, |
205 |
+ |
206 |
+ if (!hv_dev->channel) |
207 |
+ return -ENODEV; |
208 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
209 |
++ return -EINVAL; |
210 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); |
211 |
+ return sprintf(buf, "%d\n", outbound.current_read_index); |
212 |
+ } |
213 |
+@@ -344,6 +348,8 @@ static ssize_t out_write_index_show(struct device *dev, |
214 |
+ |
215 |
+ if (!hv_dev->channel) |
216 |
+ return -ENODEV; |
217 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
218 |
++ return -EINVAL; |
219 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); |
220 |
+ return sprintf(buf, "%d\n", outbound.current_write_index); |
221 |
+ } |
222 |
+@@ -358,6 +364,8 @@ static ssize_t out_read_bytes_avail_show(struct device *dev, |
223 |
+ |
224 |
+ if (!hv_dev->channel) |
225 |
+ return -ENODEV; |
226 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
227 |
++ return -EINVAL; |
228 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); |
229 |
+ return sprintf(buf, "%d\n", outbound.bytes_avail_toread); |
230 |
+ } |
231 |
+@@ -372,6 +380,8 @@ static ssize_t out_write_bytes_avail_show(struct device *dev, |
232 |
+ |
233 |
+ if (!hv_dev->channel) |
234 |
+ return -ENODEV; |
235 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
236 |
++ return -EINVAL; |
237 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); |
238 |
+ return sprintf(buf, "%d\n", outbound.bytes_avail_towrite); |
239 |
+ } |
240 |
+@@ -385,6 +395,8 @@ static ssize_t in_intr_mask_show(struct device *dev, |
241 |
+ |
242 |
+ if (!hv_dev->channel) |
243 |
+ return -ENODEV; |
244 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
245 |
++ return -EINVAL; |
246 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); |
247 |
+ return sprintf(buf, "%d\n", inbound.current_interrupt_mask); |
248 |
+ } |
249 |
+@@ -398,6 +410,8 @@ static ssize_t in_read_index_show(struct device *dev, |
250 |
+ |
251 |
+ if (!hv_dev->channel) |
252 |
+ return -ENODEV; |
253 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
254 |
++ return -EINVAL; |
255 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); |
256 |
+ return sprintf(buf, "%d\n", inbound.current_read_index); |
257 |
+ } |
258 |
+@@ -411,6 +425,8 @@ static ssize_t in_write_index_show(struct device *dev, |
259 |
+ |
260 |
+ if (!hv_dev->channel) |
261 |
+ return -ENODEV; |
262 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
263 |
++ return -EINVAL; |
264 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); |
265 |
+ return sprintf(buf, "%d\n", inbound.current_write_index); |
266 |
+ } |
267 |
+@@ -425,6 +441,8 @@ static ssize_t in_read_bytes_avail_show(struct device *dev, |
268 |
+ |
269 |
+ if (!hv_dev->channel) |
270 |
+ return -ENODEV; |
271 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
272 |
++ return -EINVAL; |
273 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); |
274 |
+ return sprintf(buf, "%d\n", inbound.bytes_avail_toread); |
275 |
+ } |
276 |
+@@ -439,6 +457,8 @@ static ssize_t in_write_bytes_avail_show(struct device *dev, |
277 |
+ |
278 |
+ if (!hv_dev->channel) |
279 |
+ return -ENODEV; |
280 |
++ if (hv_dev->channel->state != CHANNEL_OPENED_STATE) |
281 |
++ return -EINVAL; |
282 |
+ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); |
283 |
+ return sprintf(buf, "%d\n", inbound.bytes_avail_towrite); |
284 |
+ } |
285 |
+diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c |
286 |
+index fe7c6ec67d98..2a44a2c3e859 100644 |
287 |
+--- a/drivers/infiniband/ulp/srpt/ib_srpt.c |
288 |
++++ b/drivers/infiniband/ulp/srpt/ib_srpt.c |
289 |
+@@ -1763,8 +1763,8 @@ static void __srpt_close_all_ch(struct srpt_device *sdev) |
290 |
+ |
291 |
+ list_for_each_entry(ch, &sdev->rch_list, list) { |
292 |
+ if (srpt_disconnect_ch(ch) >= 0) |
293 |
+- pr_info("Closing channel %s-%d because target %s has been disabled\n", |
294 |
+- ch->sess_name, ch->qp->qp_num, |
295 |
++ pr_info("Closing channel %s because target %s has been disabled\n", |
296 |
++ ch->sess_name, |
297 |
+ sdev->device->name); |
298 |
+ srpt_close_ch(ch); |
299 |
+ } |
300 |
+diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c |
301 |
+index 0c6de9f12ee8..97e51309d7af 100644 |
302 |
+--- a/drivers/mmc/core/mmc.c |
303 |
++++ b/drivers/mmc/core/mmc.c |
304 |
+@@ -27,6 +27,7 @@ |
305 |
+ #include "sd_ops.h" |
306 |
+ |
307 |
+ #define DEFAULT_CMD6_TIMEOUT_MS 500 |
308 |
++#define MIN_CACHE_EN_TIMEOUT_MS 1600 |
309 |
+ |
310 |
+ static const unsigned int tran_exp[] = { |
311 |
+ 10000, 100000, 1000000, 10000000, |
312 |
+@@ -522,8 +523,7 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) |
313 |
+ card->cid.year += 16; |
314 |
+ |
315 |
+ /* check whether the eMMC card supports BKOPS */ |
316 |
+- if (!mmc_card_broken_hpi(card) && |
317 |
+- ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { |
318 |
++ if (ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { |
319 |
+ card->ext_csd.bkops = 1; |
320 |
+ card->ext_csd.man_bkops_en = |
321 |
+ (ext_csd[EXT_CSD_BKOPS_EN] & |
322 |
+@@ -1719,20 +1719,26 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, |
323 |
+ if (err) { |
324 |
+ pr_warn("%s: Enabling HPI failed\n", |
325 |
+ mmc_hostname(card->host)); |
326 |
++ card->ext_csd.hpi_en = 0; |
327 |
+ err = 0; |
328 |
+- } else |
329 |
++ } else { |
330 |
+ card->ext_csd.hpi_en = 1; |
331 |
++ } |
332 |
+ } |
333 |
+ |
334 |
+ /* |
335 |
+- * If cache size is higher than 0, this indicates |
336 |
+- * the existence of cache and it can be turned on. |
337 |
++ * If cache size is higher than 0, this indicates the existence of cache |
338 |
++ * and it can be turned on. Note that some eMMCs from Micron has been |
339 |
++ * reported to need ~800 ms timeout, while enabling the cache after |
340 |
++ * sudden power failure tests. Let's extend the timeout to a minimum of |
341 |
++ * DEFAULT_CACHE_EN_TIMEOUT_MS and do it for all cards. |
342 |
+ */ |
343 |
+- if (!mmc_card_broken_hpi(card) && |
344 |
+- card->ext_csd.cache_size > 0) { |
345 |
++ if (card->ext_csd.cache_size > 0) { |
346 |
++ unsigned int timeout_ms = MIN_CACHE_EN_TIMEOUT_MS; |
347 |
++ |
348 |
++ timeout_ms = max(card->ext_csd.generic_cmd6_time, timeout_ms); |
349 |
+ err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, |
350 |
+- EXT_CSD_CACHE_CTRL, 1, |
351 |
+- card->ext_csd.generic_cmd6_time); |
352 |
++ EXT_CSD_CACHE_CTRL, 1, timeout_ms); |
353 |
+ if (err && err != -EBADMSG) |
354 |
+ goto free_card; |
355 |
+ |
356 |
+diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c |
357 |
+index f7d1c8c4e5ad..009242bcc7be 100644 |
358 |
+--- a/drivers/mmc/host/omap_hsmmc.c |
359 |
++++ b/drivers/mmc/host/omap_hsmmc.c |
360 |
+@@ -2105,7 +2105,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev) |
361 |
+ mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ |
362 |
+ mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */ |
363 |
+ mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; |
364 |
+- mmc->max_seg_size = mmc->max_req_size; |
365 |
+ |
366 |
+ mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | |
367 |
+ MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE; |
368 |
+@@ -2135,6 +2134,17 @@ static int omap_hsmmc_probe(struct platform_device *pdev) |
369 |
+ goto err_irq; |
370 |
+ } |
371 |
+ |
372 |
++ /* |
373 |
++ * Limit the maximum segment size to the lower of the request size |
374 |
++ * and the DMA engine device segment size limits. In reality, with |
375 |
++ * 32-bit transfers, the DMA engine can do longer segments than this |
376 |
++ * but there is no way to represent that in the DMA model - if we |
377 |
++ * increase this figure here, we get warnings from the DMA API debug. |
378 |
++ */ |
379 |
++ mmc->max_seg_size = min3(mmc->max_req_size, |
380 |
++ dma_get_max_seg_size(host->rx_chan->device->dev), |
381 |
++ dma_get_max_seg_size(host->tx_chan->device->dev)); |
382 |
++ |
383 |
+ /* Request IRQ for MMC operations */ |
384 |
+ ret = devm_request_irq(&pdev->dev, host->irq, omap_hsmmc_irq, 0, |
385 |
+ mmc_hostname(mmc), host); |
386 |
+diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c |
387 |
+index e7b516342678..66ae647b712e 100644 |
388 |
+--- a/drivers/net/usb/hso.c |
389 |
++++ b/drivers/net/usb/hso.c |
390 |
+@@ -2808,6 +2808,12 @@ static int hso_get_config_data(struct usb_interface *interface) |
391 |
+ return -EIO; |
392 |
+ } |
393 |
+ |
394 |
++ /* check if we have a valid interface */ |
395 |
++ if (if_num > 16) { |
396 |
++ kfree(config_data); |
397 |
++ return -EINVAL; |
398 |
++ } |
399 |
++ |
400 |
+ switch (config_data[if_num]) { |
401 |
+ case 0x0: |
402 |
+ result = 0; |
403 |
+@@ -2878,10 +2884,18 @@ static int hso_probe(struct usb_interface *interface, |
404 |
+ |
405 |
+ /* Get the interface/port specification from either driver_info or from |
406 |
+ * the device itself */ |
407 |
+- if (id->driver_info) |
408 |
++ if (id->driver_info) { |
409 |
++ /* if_num is controlled by the device, driver_info is a 0 terminated |
410 |
++ * array. Make sure, the access is in bounds! */ |
411 |
++ for (i = 0; i <= if_num; ++i) |
412 |
++ if (((u32 *)(id->driver_info))[i] == 0) |
413 |
++ goto exit; |
414 |
+ port_spec = ((u32 *)(id->driver_info))[if_num]; |
415 |
+- else |
416 |
++ } else { |
417 |
+ port_spec = hso_get_config_data(interface); |
418 |
++ if (port_spec < 0) |
419 |
++ goto exit; |
420 |
++ } |
421 |
+ |
422 |
+ /* Check if we need to switch to alt interfaces prior to port |
423 |
+ * configuration */ |
424 |
+diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c |
425 |
+index 00d10660ff14..39e2d3271035 100644 |
426 |
+--- a/drivers/usb/host/xhci-hub.c |
427 |
++++ b/drivers/usb/host/xhci-hub.c |
428 |
+@@ -1353,7 +1353,8 @@ int xhci_bus_suspend(struct usb_hcd *hcd) |
429 |
+ portsc_buf[port_index] = 0; |
430 |
+ |
431 |
+ /* Bail out if a USB3 port has a new device in link training */ |
432 |
+- if ((t1 & PORT_PLS_MASK) == XDEV_POLLING) { |
433 |
++ if ((hcd->speed >= HCD_USB3) && |
434 |
++ (t1 & PORT_PLS_MASK) == XDEV_POLLING) { |
435 |
+ bus_state->bus_suspended = 0; |
436 |
+ spin_unlock_irqrestore(&xhci->lock, flags); |
437 |
+ xhci_dbg(xhci, "Bus suspend bailout, port in polling\n"); |
438 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
439 |
+index 2b81939fecd7..1e3445dd84b2 100644 |
440 |
+--- a/drivers/usb/serial/option.c |
441 |
++++ b/drivers/usb/serial/option.c |
442 |
+@@ -1163,6 +1163,10 @@ static const struct usb_device_id option_ids[] = { |
443 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1213, 0xff) }, |
444 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1214), |
445 |
+ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) }, |
446 |
++ { USB_DEVICE(TELIT_VENDOR_ID, 0x1900), /* Telit LN940 (QMI) */ |
447 |
++ .driver_info = NCTRL(0) | RSVD(1) }, |
448 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1901, 0xff), /* Telit LN940 (MBIM) */ |
449 |
++ .driver_info = NCTRL(0) }, |
450 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ |
451 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff), |
452 |
+ .driver_info = RSVD(1) }, |
453 |
+@@ -1327,6 +1331,7 @@ static const struct usb_device_id option_ids[] = { |
454 |
+ .driver_info = RSVD(4) }, |
455 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) }, |
456 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) }, |
457 |
++ { USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x0602, 0xff) }, /* GosunCn ZTE WeLink ME3630 (MBIM mode) */ |
458 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff), |
459 |
+ .driver_info = RSVD(4) }, |
460 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff), |
461 |
+@@ -1530,6 +1535,7 @@ static const struct usb_device_id option_ids[] = { |
462 |
+ .driver_info = RSVD(2) }, |
463 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xff), /* Telewell TW-LTE 4G v2 */ |
464 |
+ .driver_info = RSVD(2) }, |
465 |
++ { USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x1476, 0xff) }, /* GosunCn ZTE WeLink ME3630 (ECM/NCM mode) */ |
466 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) }, |
467 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) }, |
468 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) }, |
469 |
+@@ -1757,6 +1763,7 @@ static const struct usb_device_id option_ids[] = { |
470 |
+ { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, |
471 |
+ { USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E), |
472 |
+ .driver_info = RSVD(5) | RSVD(6) }, |
473 |
++ { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */ |
474 |
+ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), |
475 |
+ .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) }, |
476 |
+ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D), |
477 |
+@@ -1941,7 +1948,14 @@ static const struct usb_device_id option_ids[] = { |
478 |
+ { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_WMD200, 0xff, 0xff, 0xff) }, |
479 |
+ { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_6802, 0xff, 0xff, 0xff) }, |
480 |
+ { USB_DEVICE_AND_INTERFACE_INFO(WETELECOM_VENDOR_ID, WETELECOM_PRODUCT_WMD300, 0xff, 0xff, 0xff) }, |
481 |
+- { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d, 0xff, 0xff, 0xff) }, /* HP lt2523 (Novatel E371) */ |
482 |
++ { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d, 0xff, 0xff, 0xff) }, /* HP lt2523 (Novatel E371) */ |
483 |
++ { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x10) }, /* HP lt4132 (Huawei ME906s-158) */ |
484 |
++ { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x12) }, |
485 |
++ { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x13) }, |
486 |
++ { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x14) }, |
487 |
++ { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x1b) }, |
488 |
++ { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 */ |
489 |
++ .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, |
490 |
+ { } /* Terminating entry */ |
491 |
+ }; |
492 |
+ MODULE_DEVICE_TABLE(usb, option_ids); |
493 |
+diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c |
494 |
+index 46cd2e1b055b..1999e85840d5 100644 |
495 |
+--- a/fs/proc/proc_sysctl.c |
496 |
++++ b/fs/proc/proc_sysctl.c |
497 |
+@@ -466,7 +466,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, |
498 |
+ |
499 |
+ inode = new_inode(sb); |
500 |
+ if (!inode) |
501 |
+- goto out; |
502 |
++ return ERR_PTR(-ENOMEM); |
503 |
+ |
504 |
+ inode->i_ino = get_next_ino(); |
505 |
+ |
506 |
+@@ -476,8 +476,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, |
507 |
+ if (unlikely(head->unregistering)) { |
508 |
+ spin_unlock(&sysctl_lock); |
509 |
+ iput(inode); |
510 |
+- inode = NULL; |
511 |
+- goto out; |
512 |
++ return ERR_PTR(-ENOENT); |
513 |
+ } |
514 |
+ ei->sysctl = head; |
515 |
+ ei->sysctl_entry = table; |
516 |
+@@ -502,7 +501,6 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, |
517 |
+ if (root->set_ownership) |
518 |
+ root->set_ownership(head, table, &inode->i_uid, &inode->i_gid); |
519 |
+ |
520 |
+-out: |
521 |
+ return inode; |
522 |
+ } |
523 |
+ |
524 |
+@@ -551,10 +549,11 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, |
525 |
+ goto out; |
526 |
+ } |
527 |
+ |
528 |
+- err = ERR_PTR(-ENOMEM); |
529 |
+ inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p); |
530 |
+- if (!inode) |
531 |
++ if (IS_ERR(inode)) { |
532 |
++ err = ERR_CAST(inode); |
533 |
+ goto out; |
534 |
++ } |
535 |
+ |
536 |
+ err = NULL; |
537 |
+ d_set_d_op(dentry, &proc_sys_dentry_operations); |
538 |
+@@ -687,7 +686,7 @@ static bool proc_sys_fill_cache(struct file *file, |
539 |
+ return false; |
540 |
+ if (d_in_lookup(child)) { |
541 |
+ inode = proc_sys_make_inode(dir->d_sb, head, table); |
542 |
+- if (!inode) { |
543 |
++ if (IS_ERR(inode)) { |
544 |
+ d_lookup_done(child); |
545 |
+ dput(child); |
546 |
+ return false; |
547 |
+diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c |
548 |
+index fb0f44cd1e28..de7799a0a9d1 100644 |
549 |
+--- a/fs/ubifs/replay.c |
550 |
++++ b/fs/ubifs/replay.c |
551 |
+@@ -209,6 +209,38 @@ static int trun_remove_range(struct ubifs_info *c, struct replay_entry *r) |
552 |
+ return ubifs_tnc_remove_range(c, &min_key, &max_key); |
553 |
+ } |
554 |
+ |
555 |
++/** |
556 |
++ * inode_still_linked - check whether inode in question will be re-linked. |
557 |
++ * @c: UBIFS file-system description object |
558 |
++ * @rino: replay entry to test |
559 |
++ * |
560 |
++ * O_TMPFILE files can be re-linked, this means link count goes from 0 to 1. |
561 |
++ * This case needs special care, otherwise all references to the inode will |
562 |
++ * be removed upon the first replay entry of an inode with link count 0 |
563 |
++ * is found. |
564 |
++ */ |
565 |
++static bool inode_still_linked(struct ubifs_info *c, struct replay_entry *rino) |
566 |
++{ |
567 |
++ struct replay_entry *r; |
568 |
++ |
569 |
++ ubifs_assert(rino->deletion); |
570 |
++ ubifs_assert(key_type(c, &rino->key) == UBIFS_INO_KEY); |
571 |
++ |
572 |
++ /* |
573 |
++ * Find the most recent entry for the inode behind @rino and check |
574 |
++ * whether it is a deletion. |
575 |
++ */ |
576 |
++ list_for_each_entry_reverse(r, &c->replay_list, list) { |
577 |
++ ubifs_assert(r->sqnum >= rino->sqnum); |
578 |
++ if (key_inum(c, &r->key) == key_inum(c, &rino->key)) |
579 |
++ return r->deletion == 0; |
580 |
++ |
581 |
++ } |
582 |
++ |
583 |
++ ubifs_assert(0); |
584 |
++ return false; |
585 |
++} |
586 |
++ |
587 |
+ /** |
588 |
+ * apply_replay_entry - apply a replay entry to the TNC. |
589 |
+ * @c: UBIFS file-system description object |
590 |
+@@ -239,6 +271,11 @@ static int apply_replay_entry(struct ubifs_info *c, struct replay_entry *r) |
591 |
+ { |
592 |
+ ino_t inum = key_inum(c, &r->key); |
593 |
+ |
594 |
++ if (inode_still_linked(c, r)) { |
595 |
++ err = 0; |
596 |
++ break; |
597 |
++ } |
598 |
++ |
599 |
+ err = ubifs_tnc_remove_ino(c, inum); |
600 |
+ break; |
601 |
+ } |
602 |
+diff --git a/kernel/panic.c b/kernel/panic.c |
603 |
+index dbec387099b1..eb7bc6d60927 100644 |
604 |
+--- a/kernel/panic.c |
605 |
++++ b/kernel/panic.c |
606 |
+@@ -13,6 +13,7 @@ |
607 |
+ #include <linux/kmsg_dump.h> |
608 |
+ #include <linux/kallsyms.h> |
609 |
+ #include <linux/notifier.h> |
610 |
++#include <linux/vt_kern.h> |
611 |
+ #include <linux/module.h> |
612 |
+ #include <linux/random.h> |
613 |
+ #include <linux/ftrace.h> |
614 |
+@@ -228,7 +229,10 @@ void panic(const char *fmt, ...) |
615 |
+ if (_crash_kexec_post_notifiers) |
616 |
+ __crash_kexec(NULL); |
617 |
+ |
618 |
+- bust_spinlocks(0); |
619 |
++#ifdef CONFIG_VT |
620 |
++ unblank_screen(); |
621 |
++#endif |
622 |
++ console_unblank(); |
623 |
+ |
624 |
+ /* |
625 |
+ * We may have ended up stopping the CPU holding the lock (in |