1 |
commit: 33149760c20eb16b8b20dab10905a20faae2aa89 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 25 10:26:00 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 25 10:26:00 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=33149760 |
7 |
|
8 |
Linux patch 4.9.115 |
9 |
|
10 |
0000_README | 4 + |
11 |
1114_linux-4.9.115.patch | 882 +++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 886 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index c3aaa60..08ae694 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -499,6 +499,10 @@ Patch: 1113_linux-4.9.114.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.9.114 |
21 |
|
22 |
+Patch: 1114_linux-4.9.115.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.9.115 |
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/1114_linux-4.9.115.patch b/1114_linux-4.9.115.patch |
31 |
new file mode 100644 |
32 |
index 0000000..44df2d3 |
33 |
--- /dev/null |
34 |
+++ b/1114_linux-4.9.115.patch |
35 |
@@ -0,0 +1,882 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index f4cd42c9b940..889c58e39928 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,6 +1,6 @@ |
41 |
+ VERSION = 4 |
42 |
+ PATCHLEVEL = 9 |
43 |
+-SUBLEVEL = 114 |
44 |
++SUBLEVEL = 115 |
45 |
+ EXTRAVERSION = |
46 |
+ NAME = Roaring Lionus |
47 |
+ |
48 |
+diff --git a/arch/arc/configs/axs101_defconfig b/arch/arc/configs/axs101_defconfig |
49 |
+index 0a0eaf09aac7..5367fe36b69d 100644 |
50 |
+--- a/arch/arc/configs/axs101_defconfig |
51 |
++++ b/arch/arc/configs/axs101_defconfig |
52 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
53 |
+ # CONFIG_UTS_NS is not set |
54 |
+ # CONFIG_PID_NS is not set |
55 |
+ CONFIG_BLK_DEV_INITRD=y |
56 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
57 |
+ CONFIG_EMBEDDED=y |
58 |
+ CONFIG_PERF_EVENTS=y |
59 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
60 |
+diff --git a/arch/arc/configs/axs103_defconfig b/arch/arc/configs/axs103_defconfig |
61 |
+index 2233f5777a71..d40fad485982 100644 |
62 |
+--- a/arch/arc/configs/axs103_defconfig |
63 |
++++ b/arch/arc/configs/axs103_defconfig |
64 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
65 |
+ # CONFIG_UTS_NS is not set |
66 |
+ # CONFIG_PID_NS is not set |
67 |
+ CONFIG_BLK_DEV_INITRD=y |
68 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
69 |
+ CONFIG_EMBEDDED=y |
70 |
+ CONFIG_PERF_EVENTS=y |
71 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
72 |
+diff --git a/arch/arc/configs/axs103_smp_defconfig b/arch/arc/configs/axs103_smp_defconfig |
73 |
+index 110874705085..06cbd27ef860 100644 |
74 |
+--- a/arch/arc/configs/axs103_smp_defconfig |
75 |
++++ b/arch/arc/configs/axs103_smp_defconfig |
76 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
77 |
+ # CONFIG_UTS_NS is not set |
78 |
+ # CONFIG_PID_NS is not set |
79 |
+ CONFIG_BLK_DEV_INITRD=y |
80 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
81 |
+ CONFIG_EMBEDDED=y |
82 |
+ CONFIG_PERF_EVENTS=y |
83 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
84 |
+diff --git a/arch/arc/configs/nsim_700_defconfig b/arch/arc/configs/nsim_700_defconfig |
85 |
+index b0066a749d4c..df609fce999b 100644 |
86 |
+--- a/arch/arc/configs/nsim_700_defconfig |
87 |
++++ b/arch/arc/configs/nsim_700_defconfig |
88 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
89 |
+ # CONFIG_UTS_NS is not set |
90 |
+ # CONFIG_PID_NS is not set |
91 |
+ CONFIG_BLK_DEV_INITRD=y |
92 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
93 |
+ CONFIG_KALLSYMS_ALL=y |
94 |
+ CONFIG_EMBEDDED=y |
95 |
+ CONFIG_PERF_EVENTS=y |
96 |
+diff --git a/arch/arc/configs/nsim_hs_defconfig b/arch/arc/configs/nsim_hs_defconfig |
97 |
+index ebe9ebb92933..1dbb661b4c86 100644 |
98 |
+--- a/arch/arc/configs/nsim_hs_defconfig |
99 |
++++ b/arch/arc/configs/nsim_hs_defconfig |
100 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
101 |
+ # CONFIG_UTS_NS is not set |
102 |
+ # CONFIG_PID_NS is not set |
103 |
+ CONFIG_BLK_DEV_INITRD=y |
104 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
105 |
+ CONFIG_KALLSYMS_ALL=y |
106 |
+ CONFIG_EMBEDDED=y |
107 |
+ CONFIG_PERF_EVENTS=y |
108 |
+diff --git a/arch/arc/configs/nsim_hs_smp_defconfig b/arch/arc/configs/nsim_hs_smp_defconfig |
109 |
+index 4bde43278be6..cb36a69e5ed1 100644 |
110 |
+--- a/arch/arc/configs/nsim_hs_smp_defconfig |
111 |
++++ b/arch/arc/configs/nsim_hs_smp_defconfig |
112 |
+@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y |
113 |
+ # CONFIG_UTS_NS is not set |
114 |
+ # CONFIG_PID_NS is not set |
115 |
+ CONFIG_BLK_DEV_INITRD=y |
116 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
117 |
+ CONFIG_KALLSYMS_ALL=y |
118 |
+ CONFIG_EMBEDDED=y |
119 |
+ CONFIG_PERF_EVENTS=y |
120 |
+diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig |
121 |
+index f6fb3d26557e..5680daa65471 100644 |
122 |
+--- a/arch/arc/configs/nsimosci_defconfig |
123 |
++++ b/arch/arc/configs/nsimosci_defconfig |
124 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
125 |
+ # CONFIG_UTS_NS is not set |
126 |
+ # CONFIG_PID_NS is not set |
127 |
+ CONFIG_BLK_DEV_INITRD=y |
128 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
129 |
+ CONFIG_KALLSYMS_ALL=y |
130 |
+ CONFIG_EMBEDDED=y |
131 |
+ CONFIG_PERF_EVENTS=y |
132 |
+diff --git a/arch/arc/configs/nsimosci_hs_defconfig b/arch/arc/configs/nsimosci_hs_defconfig |
133 |
+index b9f0fe00044b..87decc491c58 100644 |
134 |
+--- a/arch/arc/configs/nsimosci_hs_defconfig |
135 |
++++ b/arch/arc/configs/nsimosci_hs_defconfig |
136 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
137 |
+ # CONFIG_UTS_NS is not set |
138 |
+ # CONFIG_PID_NS is not set |
139 |
+ CONFIG_BLK_DEV_INITRD=y |
140 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
141 |
+ CONFIG_KALLSYMS_ALL=y |
142 |
+ CONFIG_EMBEDDED=y |
143 |
+ CONFIG_PERF_EVENTS=y |
144 |
+diff --git a/arch/arc/configs/nsimosci_hs_smp_defconfig b/arch/arc/configs/nsimosci_hs_smp_defconfig |
145 |
+index 6da71ba253a9..4d14684dc74a 100644 |
146 |
+--- a/arch/arc/configs/nsimosci_hs_smp_defconfig |
147 |
++++ b/arch/arc/configs/nsimosci_hs_smp_defconfig |
148 |
+@@ -9,7 +9,6 @@ CONFIG_IKCONFIG_PROC=y |
149 |
+ # CONFIG_UTS_NS is not set |
150 |
+ # CONFIG_PID_NS is not set |
151 |
+ CONFIG_BLK_DEV_INITRD=y |
152 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
153 |
+ CONFIG_PERF_EVENTS=y |
154 |
+ # CONFIG_COMPAT_BRK is not set |
155 |
+ CONFIG_KPROBES=y |
156 |
+diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h |
157 |
+index 296c3426a6ad..ffb5f33475f1 100644 |
158 |
+--- a/arch/arc/include/asm/page.h |
159 |
++++ b/arch/arc/include/asm/page.h |
160 |
+@@ -105,7 +105,7 @@ typedef pte_t * pgtable_t; |
161 |
+ #define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr)) |
162 |
+ |
163 |
+ /* Default Permissions for stack/heaps pages (Non Executable) */ |
164 |
+-#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE) |
165 |
++#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
166 |
+ |
167 |
+ #define WANT_PAGE_VIRTUAL 1 |
168 |
+ |
169 |
+diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h |
170 |
+index e94ca72b974e..c10f5cb203e6 100644 |
171 |
+--- a/arch/arc/include/asm/pgtable.h |
172 |
++++ b/arch/arc/include/asm/pgtable.h |
173 |
+@@ -378,7 +378,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, |
174 |
+ |
175 |
+ /* Decode a PTE containing swap "identifier "into constituents */ |
176 |
+ #define __swp_type(pte_lookalike) (((pte_lookalike).val) & 0x1f) |
177 |
+-#define __swp_offset(pte_lookalike) ((pte_lookalike).val << 13) |
178 |
++#define __swp_offset(pte_lookalike) ((pte_lookalike).val >> 13) |
179 |
+ |
180 |
+ /* NOPs, to keep generic kernel happy */ |
181 |
+ #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
182 |
+diff --git a/arch/x86/include/asm/apm.h b/arch/x86/include/asm/apm.h |
183 |
+index 46e40aeae446..93eebc636c76 100644 |
184 |
+--- a/arch/x86/include/asm/apm.h |
185 |
++++ b/arch/x86/include/asm/apm.h |
186 |
+@@ -6,8 +6,6 @@ |
187 |
+ #ifndef _ASM_X86_MACH_DEFAULT_APM_H |
188 |
+ #define _ASM_X86_MACH_DEFAULT_APM_H |
189 |
+ |
190 |
+-#include <asm/nospec-branch.h> |
191 |
+- |
192 |
+ #ifdef APM_ZERO_SEGS |
193 |
+ # define APM_DO_ZERO_SEGS \ |
194 |
+ "pushl %%ds\n\t" \ |
195 |
+@@ -33,7 +31,6 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in, |
196 |
+ * N.B. We do NOT need a cld after the BIOS call |
197 |
+ * because we always save and restore the flags. |
198 |
+ */ |
199 |
+- firmware_restrict_branch_speculation_start(); |
200 |
+ __asm__ __volatile__(APM_DO_ZERO_SEGS |
201 |
+ "pushl %%edi\n\t" |
202 |
+ "pushl %%ebp\n\t" |
203 |
+@@ -46,7 +43,6 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in, |
204 |
+ "=S" (*esi) |
205 |
+ : "a" (func), "b" (ebx_in), "c" (ecx_in) |
206 |
+ : "memory", "cc"); |
207 |
+- firmware_restrict_branch_speculation_end(); |
208 |
+ } |
209 |
+ |
210 |
+ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
211 |
+@@ -59,7 +55,6 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
212 |
+ * N.B. We do NOT need a cld after the BIOS call |
213 |
+ * because we always save and restore the flags. |
214 |
+ */ |
215 |
+- firmware_restrict_branch_speculation_start(); |
216 |
+ __asm__ __volatile__(APM_DO_ZERO_SEGS |
217 |
+ "pushl %%edi\n\t" |
218 |
+ "pushl %%ebp\n\t" |
219 |
+@@ -72,7 +67,6 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
220 |
+ "=S" (si) |
221 |
+ : "a" (func), "b" (ebx_in), "c" (ecx_in) |
222 |
+ : "memory", "cc"); |
223 |
+- firmware_restrict_branch_speculation_end(); |
224 |
+ return error; |
225 |
+ } |
226 |
+ |
227 |
+diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c |
228 |
+index 51287cd90bf6..313a85a7b222 100644 |
229 |
+--- a/arch/x86/kernel/apm_32.c |
230 |
++++ b/arch/x86/kernel/apm_32.c |
231 |
+@@ -239,6 +239,7 @@ |
232 |
+ #include <asm/olpc.h> |
233 |
+ #include <asm/paravirt.h> |
234 |
+ #include <asm/reboot.h> |
235 |
++#include <asm/nospec-branch.h> |
236 |
+ |
237 |
+ #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) |
238 |
+ extern int (*console_blank_hook)(int); |
239 |
+@@ -613,11 +614,13 @@ static long __apm_bios_call(void *_call) |
240 |
+ gdt[0x40 / 8] = bad_bios_desc; |
241 |
+ |
242 |
+ apm_irq_save(flags); |
243 |
++ firmware_restrict_branch_speculation_start(); |
244 |
+ APM_DO_SAVE_SEGS; |
245 |
+ apm_bios_call_asm(call->func, call->ebx, call->ecx, |
246 |
+ &call->eax, &call->ebx, &call->ecx, &call->edx, |
247 |
+ &call->esi); |
248 |
+ APM_DO_RESTORE_SEGS; |
249 |
++ firmware_restrict_branch_speculation_end(); |
250 |
+ apm_irq_restore(flags); |
251 |
+ gdt[0x40 / 8] = save_desc_40; |
252 |
+ put_cpu(); |
253 |
+@@ -689,10 +692,12 @@ static long __apm_bios_call_simple(void *_call) |
254 |
+ gdt[0x40 / 8] = bad_bios_desc; |
255 |
+ |
256 |
+ apm_irq_save(flags); |
257 |
++ firmware_restrict_branch_speculation_start(); |
258 |
+ APM_DO_SAVE_SEGS; |
259 |
+ error = apm_bios_call_simple_asm(call->func, call->ebx, call->ecx, |
260 |
+ &call->eax); |
261 |
+ APM_DO_RESTORE_SEGS; |
262 |
++ firmware_restrict_branch_speculation_end(); |
263 |
+ apm_irq_restore(flags); |
264 |
+ gdt[0x40 / 8] = save_desc_40; |
265 |
+ put_cpu(); |
266 |
+diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c |
267 |
+index c49e146d4332..7e6163c9d434 100644 |
268 |
+--- a/arch/x86/kernel/cpu/mcheck/mce.c |
269 |
++++ b/arch/x86/kernel/cpu/mcheck/mce.c |
270 |
+@@ -2397,9 +2397,6 @@ static ssize_t store_int_with_restart(struct device *s, |
271 |
+ if (check_interval == old_check_interval) |
272 |
+ return ret; |
273 |
+ |
274 |
+- if (check_interval < 1) |
275 |
+- check_interval = 1; |
276 |
+- |
277 |
+ mutex_lock(&mce_sysfs_mutex); |
278 |
+ mce_restart(); |
279 |
+ mutex_unlock(&mce_sysfs_mutex); |
280 |
+diff --git a/block/blk-core.c b/block/blk-core.c |
281 |
+index 23daf40be371..77b99bf16c83 100644 |
282 |
+--- a/block/blk-core.c |
283 |
++++ b/block/blk-core.c |
284 |
+@@ -652,7 +652,6 @@ EXPORT_SYMBOL(blk_alloc_queue); |
285 |
+ int blk_queue_enter(struct request_queue *q, bool nowait) |
286 |
+ { |
287 |
+ while (true) { |
288 |
+- int ret; |
289 |
+ |
290 |
+ if (percpu_ref_tryget_live(&q->q_usage_counter)) |
291 |
+ return 0; |
292 |
+@@ -660,13 +659,11 @@ int blk_queue_enter(struct request_queue *q, bool nowait) |
293 |
+ if (nowait) |
294 |
+ return -EBUSY; |
295 |
+ |
296 |
+- ret = wait_event_interruptible(q->mq_freeze_wq, |
297 |
+- !atomic_read(&q->mq_freeze_depth) || |
298 |
+- blk_queue_dying(q)); |
299 |
++ wait_event(q->mq_freeze_wq, |
300 |
++ !atomic_read(&q->mq_freeze_depth) || |
301 |
++ blk_queue_dying(q)); |
302 |
+ if (blk_queue_dying(q)) |
303 |
+ return -ENODEV; |
304 |
+- if (ret) |
305 |
+- return ret; |
306 |
+ } |
307 |
+ } |
308 |
+ |
309 |
+diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c |
310 |
+index 02908e37c228..279d1e021421 100644 |
311 |
+--- a/drivers/gpu/drm/i915/i915_irq.c |
312 |
++++ b/drivers/gpu/drm/i915/i915_irq.c |
313 |
+@@ -1684,10 +1684,38 @@ static void valleyview_pipestat_irq_handler(struct drm_i915_private *dev_priv, |
314 |
+ |
315 |
+ static u32 i9xx_hpd_irq_ack(struct drm_i915_private *dev_priv) |
316 |
+ { |
317 |
+- u32 hotplug_status = I915_READ(PORT_HOTPLUG_STAT); |
318 |
++ u32 hotplug_status = 0, hotplug_status_mask; |
319 |
++ int i; |
320 |
++ |
321 |
++ if (IS_G4X(dev_priv) || |
322 |
++ IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) |
323 |
++ hotplug_status_mask = HOTPLUG_INT_STATUS_G4X | |
324 |
++ DP_AUX_CHANNEL_MASK_INT_STATUS_G4X; |
325 |
++ else |
326 |
++ hotplug_status_mask = HOTPLUG_INT_STATUS_I915; |
327 |
+ |
328 |
+- if (hotplug_status) |
329 |
++ /* |
330 |
++ * We absolutely have to clear all the pending interrupt |
331 |
++ * bits in PORT_HOTPLUG_STAT. Otherwise the ISR port |
332 |
++ * interrupt bit won't have an edge, and the i965/g4x |
333 |
++ * edge triggered IIR will not notice that an interrupt |
334 |
++ * is still pending. We can't use PORT_HOTPLUG_EN to |
335 |
++ * guarantee the edge as the act of toggling the enable |
336 |
++ * bits can itself generate a new hotplug interrupt :( |
337 |
++ */ |
338 |
++ for (i = 0; i < 10; i++) { |
339 |
++ u32 tmp = I915_READ(PORT_HOTPLUG_STAT) & hotplug_status_mask; |
340 |
++ |
341 |
++ if (tmp == 0) |
342 |
++ return hotplug_status; |
343 |
++ |
344 |
++ hotplug_status |= tmp; |
345 |
+ I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); |
346 |
++ } |
347 |
++ |
348 |
++ WARN_ONCE(1, |
349 |
++ "PORT_HOTPLUG_STAT did not clear (0x%08x)\n", |
350 |
++ I915_READ(PORT_HOTPLUG_STAT)); |
351 |
+ |
352 |
+ return hotplug_status; |
353 |
+ } |
354 |
+diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c |
355 |
+index 4ffbe850d746..6250989c83d8 100644 |
356 |
+--- a/drivers/net/ethernet/broadcom/tg3.c |
357 |
++++ b/drivers/net/ethernet/broadcom/tg3.c |
358 |
+@@ -9276,6 +9276,15 @@ static int tg3_chip_reset(struct tg3 *tp) |
359 |
+ |
360 |
+ tg3_restore_clk(tp); |
361 |
+ |
362 |
++ /* Increase the core clock speed to fix tx timeout issue for 5762 |
363 |
++ * with 100Mbps link speed. |
364 |
++ */ |
365 |
++ if (tg3_asic_rev(tp) == ASIC_REV_5762) { |
366 |
++ val = tr32(TG3_CPMU_CLCK_ORIDE_ENABLE); |
367 |
++ tw32(TG3_CPMU_CLCK_ORIDE_ENABLE, val | |
368 |
++ TG3_CPMU_MAC_ORIDE_ENABLE); |
369 |
++ } |
370 |
++ |
371 |
+ /* Reprobe ASF enable state. */ |
372 |
+ tg3_flag_clear(tp, ENABLE_ASF); |
373 |
+ tp->phy_flags &= ~(TG3_PHYFLG_1G_ON_VAUX_OK | |
374 |
+diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c |
375 |
+index bf02f8e4648a..b131e555d3c2 100644 |
376 |
+--- a/drivers/net/phy/phy_device.c |
377 |
++++ b/drivers/net/phy/phy_device.c |
378 |
+@@ -1579,11 +1579,8 @@ static int gen10g_resume(struct phy_device *phydev) |
379 |
+ |
380 |
+ static int __set_phy_supported(struct phy_device *phydev, u32 max_speed) |
381 |
+ { |
382 |
+- /* The default values for phydev->supported are provided by the PHY |
383 |
+- * driver "features" member, we want to reset to sane defaults first |
384 |
+- * before supporting higher speeds. |
385 |
+- */ |
386 |
+- phydev->supported &= PHY_DEFAULT_FEATURES; |
387 |
++ phydev->supported &= ~(PHY_1000BT_FEATURES | PHY_100BT_FEATURES | |
388 |
++ PHY_10BT_FEATURES); |
389 |
+ |
390 |
+ switch (max_speed) { |
391 |
+ default: |
392 |
+diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c |
393 |
+index 32e9ec8f1521..5be6b67492d5 100644 |
394 |
+--- a/drivers/net/usb/asix_devices.c |
395 |
++++ b/drivers/net/usb/asix_devices.c |
396 |
+@@ -640,10 +640,12 @@ static void ax88772_restore_phy(struct usbnet *dev) |
397 |
+ priv->presvd_phy_advertise); |
398 |
+ |
399 |
+ /* Restore BMCR */ |
400 |
++ if (priv->presvd_phy_bmcr & BMCR_ANENABLE) |
401 |
++ priv->presvd_phy_bmcr |= BMCR_ANRESTART; |
402 |
++ |
403 |
+ asix_mdio_write_nopm(dev->net, dev->mii.phy_id, MII_BMCR, |
404 |
+ priv->presvd_phy_bmcr); |
405 |
+ |
406 |
+- mii_nway_restart(&dev->mii); |
407 |
+ priv->presvd_phy_advertise = 0; |
408 |
+ priv->presvd_phy_bmcr = 0; |
409 |
+ } |
410 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
411 |
+index 6d654d65f8a0..31a6d87b61b2 100644 |
412 |
+--- a/drivers/net/usb/qmi_wwan.c |
413 |
++++ b/drivers/net/usb/qmi_wwan.c |
414 |
+@@ -953,6 +953,7 @@ static const struct usb_device_id products[] = { |
415 |
+ {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */ |
416 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ |
417 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ |
418 |
++ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */ |
419 |
+ {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */ |
420 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0306, 4)}, /* Quectel EP06 Mini PCIe */ |
421 |
+ |
422 |
+diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c |
423 |
+index 58a97d420572..51364621f77c 100644 |
424 |
+--- a/drivers/ptp/ptp_chardev.c |
425 |
++++ b/drivers/ptp/ptp_chardev.c |
426 |
+@@ -89,6 +89,7 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, |
427 |
+ case PTP_PF_PHYSYNC: |
428 |
+ if (chan != 0) |
429 |
+ return -EINVAL; |
430 |
++ break; |
431 |
+ default: |
432 |
+ return -EINVAL; |
433 |
+ } |
434 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
435 |
+index a7d239f5fc5f..81f25213cb41 100644 |
436 |
+--- a/drivers/usb/host/xhci.c |
437 |
++++ b/drivers/usb/host/xhci.c |
438 |
+@@ -891,6 +891,41 @@ static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) |
439 |
+ spin_unlock_irqrestore(&xhci->lock, flags); |
440 |
+ } |
441 |
+ |
442 |
++static bool xhci_pending_portevent(struct xhci_hcd *xhci) |
443 |
++{ |
444 |
++ __le32 __iomem **port_array; |
445 |
++ int port_index; |
446 |
++ u32 status; |
447 |
++ u32 portsc; |
448 |
++ |
449 |
++ status = readl(&xhci->op_regs->status); |
450 |
++ if (status & STS_EINT) |
451 |
++ return true; |
452 |
++ /* |
453 |
++ * Checking STS_EINT is not enough as there is a lag between a change |
454 |
++ * bit being set and the Port Status Change Event that it generated |
455 |
++ * being written to the Event Ring. See note in xhci 1.1 section 4.19.2. |
456 |
++ */ |
457 |
++ |
458 |
++ port_index = xhci->num_usb2_ports; |
459 |
++ port_array = xhci->usb2_ports; |
460 |
++ while (port_index--) { |
461 |
++ portsc = readl(port_array[port_index]); |
462 |
++ if (portsc & PORT_CHANGE_MASK || |
463 |
++ (portsc & PORT_PLS_MASK) == XDEV_RESUME) |
464 |
++ return true; |
465 |
++ } |
466 |
++ port_index = xhci->num_usb3_ports; |
467 |
++ port_array = xhci->usb3_ports; |
468 |
++ while (port_index--) { |
469 |
++ portsc = readl(port_array[port_index]); |
470 |
++ if (portsc & PORT_CHANGE_MASK || |
471 |
++ (portsc & PORT_PLS_MASK) == XDEV_RESUME) |
472 |
++ return true; |
473 |
++ } |
474 |
++ return false; |
475 |
++} |
476 |
++ |
477 |
+ /* |
478 |
+ * Stop HC (not bus-specific) |
479 |
+ * |
480 |
+@@ -987,7 +1022,7 @@ EXPORT_SYMBOL_GPL(xhci_suspend); |
481 |
+ */ |
482 |
+ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
483 |
+ { |
484 |
+- u32 command, temp = 0, status; |
485 |
++ u32 command, temp = 0; |
486 |
+ struct usb_hcd *hcd = xhci_to_hcd(xhci); |
487 |
+ struct usb_hcd *secondary_hcd; |
488 |
+ int retval = 0; |
489 |
+@@ -1109,8 +1144,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
490 |
+ done: |
491 |
+ if (retval == 0) { |
492 |
+ /* Resume root hubs only when have pending events. */ |
493 |
+- status = readl(&xhci->op_regs->status); |
494 |
+- if (status & STS_EINT) { |
495 |
++ if (xhci_pending_portevent(xhci)) { |
496 |
+ usb_hcd_resume_root_hub(xhci->shared_hcd); |
497 |
+ usb_hcd_resume_root_hub(hcd); |
498 |
+ } |
499 |
+diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h |
500 |
+index 836398ade58d..b9181281aa9e 100644 |
501 |
+--- a/drivers/usb/host/xhci.h |
502 |
++++ b/drivers/usb/host/xhci.h |
503 |
+@@ -385,6 +385,10 @@ struct xhci_op_regs { |
504 |
+ #define PORT_PLC (1 << 22) |
505 |
+ /* port configure error change - port failed to configure its link partner */ |
506 |
+ #define PORT_CEC (1 << 23) |
507 |
++#define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ |
508 |
++ PORT_RC | PORT_PLC | PORT_CEC) |
509 |
++ |
510 |
++ |
511 |
+ /* Cold Attach Status - xHC can set this bit to report device attached during |
512 |
+ * Sx state. Warm port reset should be perfomed to clear this bit and move port |
513 |
+ * to connected state. |
514 |
+diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c |
515 |
+index 43559bed7822..7338e43faa17 100644 |
516 |
+--- a/drivers/vfio/pci/vfio_pci.c |
517 |
++++ b/drivers/vfio/pci/vfio_pci.c |
518 |
+@@ -28,6 +28,7 @@ |
519 |
+ #include <linux/uaccess.h> |
520 |
+ #include <linux/vfio.h> |
521 |
+ #include <linux/vgaarb.h> |
522 |
++#include <linux/nospec.h> |
523 |
+ |
524 |
+ #include "vfio_pci_private.h" |
525 |
+ |
526 |
+@@ -755,6 +756,9 @@ static long vfio_pci_ioctl(void *device_data, |
527 |
+ if (info.index >= |
528 |
+ VFIO_PCI_NUM_REGIONS + vdev->num_regions) |
529 |
+ return -EINVAL; |
530 |
++ info.index = array_index_nospec(info.index, |
531 |
++ VFIO_PCI_NUM_REGIONS + |
532 |
++ vdev->num_regions); |
533 |
+ |
534 |
+ i = info.index - VFIO_PCI_NUM_REGIONS; |
535 |
+ |
536 |
+diff --git a/fs/fat/inode.c b/fs/fat/inode.c |
537 |
+index a2c05f2ada6d..88720011a6eb 100644 |
538 |
+--- a/fs/fat/inode.c |
539 |
++++ b/fs/fat/inode.c |
540 |
+@@ -696,13 +696,21 @@ static void fat_set_state(struct super_block *sb, |
541 |
+ brelse(bh); |
542 |
+ } |
543 |
+ |
544 |
++static void fat_reset_iocharset(struct fat_mount_options *opts) |
545 |
++{ |
546 |
++ if (opts->iocharset != fat_default_iocharset) { |
547 |
++ /* Note: opts->iocharset can be NULL here */ |
548 |
++ kfree(opts->iocharset); |
549 |
++ opts->iocharset = fat_default_iocharset; |
550 |
++ } |
551 |
++} |
552 |
++ |
553 |
+ static void delayed_free(struct rcu_head *p) |
554 |
+ { |
555 |
+ struct msdos_sb_info *sbi = container_of(p, struct msdos_sb_info, rcu); |
556 |
+ unload_nls(sbi->nls_disk); |
557 |
+ unload_nls(sbi->nls_io); |
558 |
+- if (sbi->options.iocharset != fat_default_iocharset) |
559 |
+- kfree(sbi->options.iocharset); |
560 |
++ fat_reset_iocharset(&sbi->options); |
561 |
+ kfree(sbi); |
562 |
+ } |
563 |
+ |
564 |
+@@ -1117,7 +1125,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, |
565 |
+ opts->fs_fmask = opts->fs_dmask = current_umask(); |
566 |
+ opts->allow_utime = -1; |
567 |
+ opts->codepage = fat_default_codepage; |
568 |
+- opts->iocharset = fat_default_iocharset; |
569 |
++ fat_reset_iocharset(opts); |
570 |
+ if (is_vfat) { |
571 |
+ opts->shortname = VFAT_SFN_DISPLAY_WINNT|VFAT_SFN_CREATE_WIN95; |
572 |
+ opts->rodir = 0; |
573 |
+@@ -1274,8 +1282,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, |
574 |
+ |
575 |
+ /* vfat specific */ |
576 |
+ case Opt_charset: |
577 |
+- if (opts->iocharset != fat_default_iocharset) |
578 |
+- kfree(opts->iocharset); |
579 |
++ fat_reset_iocharset(opts); |
580 |
+ iocharset = match_strdup(&args[0]); |
581 |
+ if (!iocharset) |
582 |
+ return -ENOMEM; |
583 |
+@@ -1866,8 +1873,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, |
584 |
+ iput(fat_inode); |
585 |
+ unload_nls(sbi->nls_io); |
586 |
+ unload_nls(sbi->nls_disk); |
587 |
+- if (sbi->options.iocharset != fat_default_iocharset) |
588 |
+- kfree(sbi->options.iocharset); |
589 |
++ fat_reset_iocharset(&sbi->options); |
590 |
+ sb->s_fs_info = NULL; |
591 |
+ kfree(sbi); |
592 |
+ return error; |
593 |
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h |
594 |
+index 1b3a2f95503d..b048d3d3b327 100644 |
595 |
+--- a/include/linux/skbuff.h |
596 |
++++ b/include/linux/skbuff.h |
597 |
+@@ -602,6 +602,7 @@ static inline bool skb_mstamp_after(const struct skb_mstamp *t1, |
598 |
+ * @hash: the packet hash |
599 |
+ * @queue_mapping: Queue mapping for multiqueue devices |
600 |
+ * @xmit_more: More SKBs are pending for this queue |
601 |
++ * @pfmemalloc: skbuff was allocated from PFMEMALLOC reserves |
602 |
+ * @ndisc_nodetype: router type (from link layer) |
603 |
+ * @ooo_okay: allow the mapping of a socket to a queue to be changed |
604 |
+ * @l4_hash: indicate hash is a canonical 4-tuple hash over transport |
605 |
+@@ -692,7 +693,7 @@ struct sk_buff { |
606 |
+ peeked:1, |
607 |
+ head_frag:1, |
608 |
+ xmit_more:1, |
609 |
+- __unused:1; /* one bit hole */ |
610 |
++ pfmemalloc:1; |
611 |
+ kmemcheck_bitfield_end(flags1); |
612 |
+ |
613 |
+ /* fields enclosed in headers_start/headers_end are copied |
614 |
+@@ -712,19 +713,18 @@ struct sk_buff { |
615 |
+ |
616 |
+ __u8 __pkt_type_offset[0]; |
617 |
+ __u8 pkt_type:3; |
618 |
+- __u8 pfmemalloc:1; |
619 |
+ __u8 ignore_df:1; |
620 |
+ __u8 nfctinfo:3; |
621 |
+- |
622 |
+ __u8 nf_trace:1; |
623 |
++ |
624 |
+ __u8 ip_summed:2; |
625 |
+ __u8 ooo_okay:1; |
626 |
+ __u8 l4_hash:1; |
627 |
+ __u8 sw_hash:1; |
628 |
+ __u8 wifi_acked_valid:1; |
629 |
+ __u8 wifi_acked:1; |
630 |
+- |
631 |
+ __u8 no_fcs:1; |
632 |
++ |
633 |
+ /* Indicates the inner headers are valid in the skbuff. */ |
634 |
+ __u8 encapsulation:1; |
635 |
+ __u8 encap_hdr_csum:1; |
636 |
+@@ -732,11 +732,11 @@ struct sk_buff { |
637 |
+ __u8 csum_complete_sw:1; |
638 |
+ __u8 csum_level:2; |
639 |
+ __u8 csum_bad:1; |
640 |
+- |
641 |
+ #ifdef CONFIG_IPV6_NDISC_NODETYPE |
642 |
+ __u8 ndisc_nodetype:2; |
643 |
+ #endif |
644 |
+ __u8 ipvs_property:1; |
645 |
++ |
646 |
+ __u8 inner_protocol_type:1; |
647 |
+ __u8 remcsum_offload:1; |
648 |
+ #ifdef CONFIG_NET_SWITCHDEV |
649 |
+diff --git a/include/net/ipv6.h b/include/net/ipv6.h |
650 |
+index e64210c98c2b..407087d686a7 100644 |
651 |
+--- a/include/net/ipv6.h |
652 |
++++ b/include/net/ipv6.h |
653 |
+@@ -794,7 +794,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb, |
654 |
+ * to minimize possbility that any useful information to an |
655 |
+ * attacker is leaked. Only lower 20 bits are relevant. |
656 |
+ */ |
657 |
+- rol32(hash, 16); |
658 |
++ hash = rol32(hash, 16); |
659 |
+ |
660 |
+ flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK; |
661 |
+ |
662 |
+diff --git a/lib/rhashtable.c b/lib/rhashtable.c |
663 |
+index 895961c53385..101dac085c62 100644 |
664 |
+--- a/lib/rhashtable.c |
665 |
++++ b/lib/rhashtable.c |
666 |
+@@ -783,8 +783,16 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_stop); |
667 |
+ |
668 |
+ static size_t rounded_hashtable_size(const struct rhashtable_params *params) |
669 |
+ { |
670 |
+- return max(roundup_pow_of_two(params->nelem_hint * 4 / 3), |
671 |
+- (unsigned long)params->min_size); |
672 |
++ size_t retsize; |
673 |
++ |
674 |
++ if (params->nelem_hint) |
675 |
++ retsize = max(roundup_pow_of_two(params->nelem_hint * 4 / 3), |
676 |
++ (unsigned long)params->min_size); |
677 |
++ else |
678 |
++ retsize = max(HASH_DEFAULT_SIZE, |
679 |
++ (unsigned long)params->min_size); |
680 |
++ |
681 |
++ return retsize; |
682 |
+ } |
683 |
+ |
684 |
+ static u32 rhashtable_jhash2(const void *key, u32 length, u32 seed) |
685 |
+@@ -841,8 +849,6 @@ int rhashtable_init(struct rhashtable *ht, |
686 |
+ struct bucket_table *tbl; |
687 |
+ size_t size; |
688 |
+ |
689 |
+- size = HASH_DEFAULT_SIZE; |
690 |
+- |
691 |
+ if ((!params->key_len && !params->obj_hashfn) || |
692 |
+ (params->obj_hashfn && !params->obj_cmpfn)) |
693 |
+ return -EINVAL; |
694 |
+@@ -869,8 +875,7 @@ int rhashtable_init(struct rhashtable *ht, |
695 |
+ |
696 |
+ ht->p.min_size = max(ht->p.min_size, HASH_MIN_SIZE); |
697 |
+ |
698 |
+- if (params->nelem_hint) |
699 |
+- size = rounded_hashtable_size(&ht->p); |
700 |
++ size = rounded_hashtable_size(&ht->p); |
701 |
+ |
702 |
+ /* The maximum (not average) chain length grows with the |
703 |
+ * size of the hash table, at a rate of (log N)/(log log N). |
704 |
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c |
705 |
+index 724372866e67..9efe88ef9702 100644 |
706 |
+--- a/mm/huge_memory.c |
707 |
++++ b/mm/huge_memory.c |
708 |
+@@ -1642,6 +1642,8 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, |
709 |
+ if (vma_is_dax(vma)) |
710 |
+ return; |
711 |
+ page = pmd_page(_pmd); |
712 |
++ if (!PageDirty(page) && pmd_dirty(_pmd)) |
713 |
++ set_page_dirty(page); |
714 |
+ if (!PageReferenced(page) && pmd_young(_pmd)) |
715 |
+ SetPageReferenced(page); |
716 |
+ page_remove_rmap(page, true); |
717 |
+diff --git a/mm/memcontrol.c b/mm/memcontrol.c |
718 |
+index 50088150fc17..349f4a8e3c4f 100644 |
719 |
+--- a/mm/memcontrol.c |
720 |
++++ b/mm/memcontrol.c |
721 |
+@@ -895,7 +895,7 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg) |
722 |
+ int nid; |
723 |
+ int i; |
724 |
+ |
725 |
+- while ((memcg = parent_mem_cgroup(memcg))) { |
726 |
++ for (; memcg; memcg = parent_mem_cgroup(memcg)) { |
727 |
+ for_each_node(nid) { |
728 |
+ mz = mem_cgroup_nodeinfo(memcg, nid); |
729 |
+ for (i = 0; i <= DEF_PRIORITY; i++) { |
730 |
+diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c |
731 |
+index 508e051304fb..18f17e1e5762 100644 |
732 |
+--- a/net/core/gen_stats.c |
733 |
++++ b/net/core/gen_stats.c |
734 |
+@@ -77,8 +77,20 @@ gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, |
735 |
+ d->lock = lock; |
736 |
+ spin_lock_bh(lock); |
737 |
+ } |
738 |
+- if (d->tail) |
739 |
+- return gnet_stats_copy(d, type, NULL, 0, padattr); |
740 |
++ if (d->tail) { |
741 |
++ int ret = gnet_stats_copy(d, type, NULL, 0, padattr); |
742 |
++ |
743 |
++ /* The initial attribute added in gnet_stats_copy() may be |
744 |
++ * preceded by a padding attribute, in which case d->tail will |
745 |
++ * end up pointing at the padding instead of the real attribute. |
746 |
++ * Fix this so gnet_stats_finish_copy() adjusts the length of |
747 |
++ * the right attribute. |
748 |
++ */ |
749 |
++ if (ret == 0 && d->tail->nla_type == padattr) |
750 |
++ d->tail = (struct nlattr *)((char *)d->tail + |
751 |
++ NLA_ALIGN(d->tail->nla_len)); |
752 |
++ return ret; |
753 |
++ } |
754 |
+ |
755 |
+ return 0; |
756 |
+ } |
757 |
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
758 |
+index 9f697b00158d..8cae7aa4a4ec 100644 |
759 |
+--- a/net/core/skbuff.c |
760 |
++++ b/net/core/skbuff.c |
761 |
+@@ -904,6 +904,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb) |
762 |
+ n->cloned = 1; |
763 |
+ n->nohdr = 0; |
764 |
+ n->peeked = 0; |
765 |
++ C(pfmemalloc); |
766 |
+ n->destructor = NULL; |
767 |
+ C(tail); |
768 |
+ C(end); |
769 |
+diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c |
770 |
+index ffae472e250a..7bdd89354db5 100644 |
771 |
+--- a/net/ipv4/fib_frontend.c |
772 |
++++ b/net/ipv4/fib_frontend.c |
773 |
+@@ -290,6 +290,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb) |
774 |
+ if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) { |
775 |
+ struct flowi4 fl4 = { |
776 |
+ .flowi4_iif = LOOPBACK_IFINDEX, |
777 |
++ .flowi4_oif = l3mdev_master_ifindex_rcu(dev), |
778 |
+ .daddr = ip_hdr(skb)->saddr, |
779 |
+ .flowi4_tos = RT_TOS(ip_hdr(skb)->tos), |
780 |
+ .flowi4_scope = scope, |
781 |
+diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c |
782 |
+index 51a0039cb318..024ab833557d 100644 |
783 |
+--- a/net/ipv4/sysctl_net_ipv4.c |
784 |
++++ b/net/ipv4/sysctl_net_ipv4.c |
785 |
+@@ -140,8 +140,9 @@ static int ipv4_ping_group_range(struct ctl_table *table, int write, |
786 |
+ if (write && ret == 0) { |
787 |
+ low = make_kgid(user_ns, urange[0]); |
788 |
+ high = make_kgid(user_ns, urange[1]); |
789 |
+- if (!gid_valid(low) || !gid_valid(high) || |
790 |
+- (urange[1] < urange[0]) || gid_lt(high, low)) { |
791 |
++ if (!gid_valid(low) || !gid_valid(high)) |
792 |
++ return -EINVAL; |
793 |
++ if (urange[1] < urange[0] || gid_lt(high, low)) { |
794 |
+ low = make_kgid(&init_user_ns, 1); |
795 |
+ high = make_kgid(&init_user_ns, 0); |
796 |
+ } |
797 |
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
798 |
+index 84ffebf0192d..8f15eae3325b 100644 |
799 |
+--- a/net/ipv4/tcp.c |
800 |
++++ b/net/ipv4/tcp.c |
801 |
+@@ -3238,8 +3238,7 @@ int tcp_abort(struct sock *sk, int err) |
802 |
+ struct request_sock *req = inet_reqsk(sk); |
803 |
+ |
804 |
+ local_bh_disable(); |
805 |
+- inet_csk_reqsk_queue_drop_and_put(req->rsk_listener, |
806 |
+- req); |
807 |
++ inet_csk_reqsk_queue_drop(req->rsk_listener, req); |
808 |
+ local_bh_enable(); |
809 |
+ return 0; |
810 |
+ } |
811 |
+diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c |
812 |
+index f57c9f0ab8f9..0287734f126f 100644 |
813 |
+--- a/net/sunrpc/xprtrdma/rpc_rdma.c |
814 |
++++ b/net/sunrpc/xprtrdma/rpc_rdma.c |
815 |
+@@ -229,7 +229,7 @@ rpcrdma_convert_iovs(struct rpcrdma_xprt *r_xprt, struct xdr_buf *xdrbuf, |
816 |
+ /* alloc the pagelist for receiving buffer */ |
817 |
+ ppages[p] = alloc_page(GFP_ATOMIC); |
818 |
+ if (!ppages[p]) |
819 |
+- return -EAGAIN; |
820 |
++ return -ENOBUFS; |
821 |
+ } |
822 |
+ seg[n].mr_page = ppages[p]; |
823 |
+ seg[n].mr_offset = (void *)(unsigned long) page_base; |
824 |
+diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c |
825 |
+index 16f8124b1150..59111cadaec2 100644 |
826 |
+--- a/sound/core/rawmidi.c |
827 |
++++ b/sound/core/rawmidi.c |
828 |
+@@ -635,7 +635,7 @@ static int snd_rawmidi_info_select_user(struct snd_card *card, |
829 |
+ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, |
830 |
+ struct snd_rawmidi_params * params) |
831 |
+ { |
832 |
+- char *newbuf; |
833 |
++ char *newbuf, *oldbuf; |
834 |
+ struct snd_rawmidi_runtime *runtime = substream->runtime; |
835 |
+ |
836 |
+ if (substream->append && substream->use_count > 1) |
837 |
+@@ -648,13 +648,17 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, |
838 |
+ return -EINVAL; |
839 |
+ } |
840 |
+ if (params->buffer_size != runtime->buffer_size) { |
841 |
+- newbuf = krealloc(runtime->buffer, params->buffer_size, |
842 |
+- GFP_KERNEL); |
843 |
++ newbuf = kmalloc(params->buffer_size, GFP_KERNEL); |
844 |
+ if (!newbuf) |
845 |
+ return -ENOMEM; |
846 |
++ spin_lock_irq(&runtime->lock); |
847 |
++ oldbuf = runtime->buffer; |
848 |
+ runtime->buffer = newbuf; |
849 |
+ runtime->buffer_size = params->buffer_size; |
850 |
+ runtime->avail = runtime->buffer_size; |
851 |
++ runtime->appl_ptr = runtime->hw_ptr = 0; |
852 |
++ spin_unlock_irq(&runtime->lock); |
853 |
++ kfree(oldbuf); |
854 |
+ } |
855 |
+ runtime->avail_min = params->avail_min; |
856 |
+ substream->active_sensing = !params->no_active_sensing; |
857 |
+@@ -665,7 +669,7 @@ EXPORT_SYMBOL(snd_rawmidi_output_params); |
858 |
+ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, |
859 |
+ struct snd_rawmidi_params * params) |
860 |
+ { |
861 |
+- char *newbuf; |
862 |
++ char *newbuf, *oldbuf; |
863 |
+ struct snd_rawmidi_runtime *runtime = substream->runtime; |
864 |
+ |
865 |
+ snd_rawmidi_drain_input(substream); |
866 |
+@@ -676,12 +680,16 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, |
867 |
+ return -EINVAL; |
868 |
+ } |
869 |
+ if (params->buffer_size != runtime->buffer_size) { |
870 |
+- newbuf = krealloc(runtime->buffer, params->buffer_size, |
871 |
+- GFP_KERNEL); |
872 |
++ newbuf = kmalloc(params->buffer_size, GFP_KERNEL); |
873 |
+ if (!newbuf) |
874 |
+ return -ENOMEM; |
875 |
++ spin_lock_irq(&runtime->lock); |
876 |
++ oldbuf = runtime->buffer; |
877 |
+ runtime->buffer = newbuf; |
878 |
+ runtime->buffer_size = params->buffer_size; |
879 |
++ runtime->appl_ptr = runtime->hw_ptr = 0; |
880 |
++ spin_unlock_irq(&runtime->lock); |
881 |
++ kfree(oldbuf); |
882 |
+ } |
883 |
+ runtime->avail_min = params->avail_min; |
884 |
+ return 0; |
885 |
+diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c |
886 |
+index 4d28a9ddbee0..3f24eb1e8554 100644 |
887 |
+--- a/virt/kvm/eventfd.c |
888 |
++++ b/virt/kvm/eventfd.c |
889 |
+@@ -119,8 +119,12 @@ irqfd_shutdown(struct work_struct *work) |
890 |
+ { |
891 |
+ struct kvm_kernel_irqfd *irqfd = |
892 |
+ container_of(work, struct kvm_kernel_irqfd, shutdown); |
893 |
++ struct kvm *kvm = irqfd->kvm; |
894 |
+ u64 cnt; |
895 |
+ |
896 |
++ /* Make sure irqfd has been initalized in assign path. */ |
897 |
++ synchronize_srcu(&kvm->irq_srcu); |
898 |
++ |
899 |
+ /* |
900 |
+ * Synchronize with the wait-queue and unhook ourselves to prevent |
901 |
+ * further events. |
902 |
+@@ -387,7 +391,6 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) |
903 |
+ |
904 |
+ idx = srcu_read_lock(&kvm->irq_srcu); |
905 |
+ irqfd_update(kvm, irqfd); |
906 |
+- srcu_read_unlock(&kvm->irq_srcu, idx); |
907 |
+ |
908 |
+ list_add_tail(&irqfd->list, &kvm->irqfds.items); |
909 |
+ |
910 |
+@@ -421,6 +424,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) |
911 |
+ } |
912 |
+ #endif |
913 |
+ |
914 |
++ srcu_read_unlock(&kvm->irq_srcu, idx); |
915 |
+ return 0; |
916 |
+ |
917 |
+ fail: |