1 |
commit: f16854e0ee94ed6b92f2599a957eb741157fcda3 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Aug 13 16:51:14 2017 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 13 16:51:14 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f16854e0 |
7 |
|
8 |
Linux patch 4.9.43 |
9 |
|
10 |
0000_README | 4 + |
11 |
1042_linux-4.9.43.patch | 548 ++++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 552 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index c5dce51..1e2c032 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -211,6 +211,10 @@ Patch: 1041_linux-4.9.42.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.9.42 |
21 |
|
22 |
+Patch: 1042_linux-4.9.43.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.9.43 |
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/1042_linux-4.9.43.patch b/1042_linux-4.9.43.patch |
31 |
new file mode 100644 |
32 |
index 0000000..d4979be |
33 |
--- /dev/null |
34 |
+++ b/1042_linux-4.9.43.patch |
35 |
@@ -0,0 +1,548 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index 34d4d9f8a4b2..77953bf3f40a 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,6 +1,6 @@ |
41 |
+ VERSION = 4 |
42 |
+ PATCHLEVEL = 9 |
43 |
+-SUBLEVEL = 42 |
44 |
++SUBLEVEL = 43 |
45 |
+ EXTRAVERSION = |
46 |
+ NAME = Roaring Lionus |
47 |
+ |
48 |
+diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile |
49 |
+index f3baa896ce84..7037201c5e3a 100644 |
50 |
+--- a/arch/arm/boot/dts/Makefile |
51 |
++++ b/arch/arm/boot/dts/Makefile |
52 |
+@@ -820,7 +820,6 @@ dtb-$(CONFIG_MACH_SUN8I) += \ |
53 |
+ sun8i-a83t-allwinner-h8homlet-v2.dtb \ |
54 |
+ sun8i-a83t-cubietruck-plus.dtb \ |
55 |
+ sun8i-h3-bananapi-m2-plus.dtb \ |
56 |
+- sun8i-h3-nanopi-m1.dtb \ |
57 |
+ sun8i-h3-nanopi-neo.dtb \ |
58 |
+ sun8i-h3-orangepi-2.dtb \ |
59 |
+ sun8i-h3-orangepi-lite.dtb \ |
60 |
+diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c |
61 |
+index 332ce3b5a34f..710511cadd50 100644 |
62 |
+--- a/arch/arm/kvm/mmu.c |
63 |
++++ b/arch/arm/kvm/mmu.c |
64 |
+@@ -1664,12 +1664,16 @@ static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data) |
65 |
+ |
66 |
+ int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end) |
67 |
+ { |
68 |
++ if (!kvm->arch.pgd) |
69 |
++ return 0; |
70 |
+ trace_kvm_age_hva(start, end); |
71 |
+ return handle_hva_to_gpa(kvm, start, end, kvm_age_hva_handler, NULL); |
72 |
+ } |
73 |
+ |
74 |
+ int kvm_test_age_hva(struct kvm *kvm, unsigned long hva) |
75 |
+ { |
76 |
++ if (!kvm->arch.pgd) |
77 |
++ return 0; |
78 |
+ trace_kvm_test_age_hva(hva); |
79 |
+ return handle_hva_to_gpa(kvm, hva, hva, kvm_test_age_hva_handler, NULL); |
80 |
+ } |
81 |
+diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c |
82 |
+index bee281f3163d..e8dee623d545 100644 |
83 |
+--- a/arch/s390/net/bpf_jit_comp.c |
84 |
++++ b/arch/s390/net/bpf_jit_comp.c |
85 |
+@@ -1252,7 +1252,8 @@ static int bpf_jit_prog(struct bpf_jit *jit, struct bpf_prog *fp) |
86 |
+ insn_count = bpf_jit_insn(jit, fp, i); |
87 |
+ if (insn_count < 0) |
88 |
+ return -1; |
89 |
+- jit->addrs[i + 1] = jit->prg; /* Next instruction address */ |
90 |
++ /* Next instruction address */ |
91 |
++ jit->addrs[i + insn_count] = jit->prg; |
92 |
+ } |
93 |
+ bpf_jit_epilogue(jit); |
94 |
+ |
95 |
+diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h |
96 |
+index 349dd23e2876..0cdeb2b483a0 100644 |
97 |
+--- a/arch/sparc/include/asm/mmu_context_64.h |
98 |
++++ b/arch/sparc/include/asm/mmu_context_64.h |
99 |
+@@ -25,9 +25,11 @@ void destroy_context(struct mm_struct *mm); |
100 |
+ void __tsb_context_switch(unsigned long pgd_pa, |
101 |
+ struct tsb_config *tsb_base, |
102 |
+ struct tsb_config *tsb_huge, |
103 |
+- unsigned long tsb_descr_pa); |
104 |
++ unsigned long tsb_descr_pa, |
105 |
++ unsigned long secondary_ctx); |
106 |
+ |
107 |
+-static inline void tsb_context_switch(struct mm_struct *mm) |
108 |
++static inline void tsb_context_switch_ctx(struct mm_struct *mm, |
109 |
++ unsigned long ctx) |
110 |
+ { |
111 |
+ __tsb_context_switch(__pa(mm->pgd), |
112 |
+ &mm->context.tsb_block[0], |
113 |
+@@ -38,9 +40,12 @@ static inline void tsb_context_switch(struct mm_struct *mm) |
114 |
+ #else |
115 |
+ NULL |
116 |
+ #endif |
117 |
+- , __pa(&mm->context.tsb_descr[0])); |
118 |
++ , __pa(&mm->context.tsb_descr[0]), |
119 |
++ ctx); |
120 |
+ } |
121 |
+ |
122 |
++#define tsb_context_switch(X) tsb_context_switch_ctx(X, 0) |
123 |
++ |
124 |
+ void tsb_grow(struct mm_struct *mm, |
125 |
+ unsigned long tsb_index, |
126 |
+ unsigned long mm_rss); |
127 |
+@@ -110,8 +115,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str |
128 |
+ * cpu0 to update it's TSB because at that point the cpu_vm_mask |
129 |
+ * only had cpu1 set in it. |
130 |
+ */ |
131 |
+- load_secondary_context(mm); |
132 |
+- tsb_context_switch(mm); |
133 |
++ tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); |
134 |
+ |
135 |
+ /* Any time a processor runs a context on an address space |
136 |
+ * for the first time, we must flush that context out of the |
137 |
+diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S |
138 |
+index 395ec1800530..7d961f6e3907 100644 |
139 |
+--- a/arch/sparc/kernel/tsb.S |
140 |
++++ b/arch/sparc/kernel/tsb.S |
141 |
+@@ -375,6 +375,7 @@ tsb_flush: |
142 |
+ * %o1: TSB base config pointer |
143 |
+ * %o2: TSB huge config pointer, or NULL if none |
144 |
+ * %o3: Hypervisor TSB descriptor physical address |
145 |
++ * %o4: Secondary context to load, if non-zero |
146 |
+ * |
147 |
+ * We have to run this whole thing with interrupts |
148 |
+ * disabled so that the current cpu doesn't change |
149 |
+@@ -387,6 +388,17 @@ __tsb_context_switch: |
150 |
+ rdpr %pstate, %g1 |
151 |
+ wrpr %g1, PSTATE_IE, %pstate |
152 |
+ |
153 |
++ brz,pn %o4, 1f |
154 |
++ mov SECONDARY_CONTEXT, %o5 |
155 |
++ |
156 |
++661: stxa %o4, [%o5] ASI_DMMU |
157 |
++ .section .sun4v_1insn_patch, "ax" |
158 |
++ .word 661b |
159 |
++ stxa %o4, [%o5] ASI_MMU |
160 |
++ .previous |
161 |
++ flush %g6 |
162 |
++ |
163 |
++1: |
164 |
+ TRAP_LOAD_TRAP_BLOCK(%g2, %g3) |
165 |
+ |
166 |
+ stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR] |
167 |
+diff --git a/arch/sparc/power/hibernate.c b/arch/sparc/power/hibernate.c |
168 |
+index 17bd2e167e07..df707a8ad311 100644 |
169 |
+--- a/arch/sparc/power/hibernate.c |
170 |
++++ b/arch/sparc/power/hibernate.c |
171 |
+@@ -35,6 +35,5 @@ void restore_processor_state(void) |
172 |
+ { |
173 |
+ struct mm_struct *mm = current->active_mm; |
174 |
+ |
175 |
+- load_secondary_context(mm); |
176 |
+- tsb_context_switch(mm); |
177 |
++ tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); |
178 |
+ } |
179 |
+diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
180 |
+index 5d484581becd..bcbb80ff86a7 100644 |
181 |
+--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
182 |
++++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
183 |
+@@ -724,16 +724,21 @@ static inline __wsum get_fixed_vlan_csum(__wsum hw_checksum, |
184 |
+ * header, the HW adds it. To address that, we are subtracting the pseudo |
185 |
+ * header checksum from the checksum value provided by the HW. |
186 |
+ */ |
187 |
+-static void get_fixed_ipv4_csum(__wsum hw_checksum, struct sk_buff *skb, |
188 |
+- struct iphdr *iph) |
189 |
++static int get_fixed_ipv4_csum(__wsum hw_checksum, struct sk_buff *skb, |
190 |
++ struct iphdr *iph) |
191 |
+ { |
192 |
+ __u16 length_for_csum = 0; |
193 |
+ __wsum csum_pseudo_header = 0; |
194 |
++ __u8 ipproto = iph->protocol; |
195 |
++ |
196 |
++ if (unlikely(ipproto == IPPROTO_SCTP)) |
197 |
++ return -1; |
198 |
+ |
199 |
+ length_for_csum = (be16_to_cpu(iph->tot_len) - (iph->ihl << 2)); |
200 |
+ csum_pseudo_header = csum_tcpudp_nofold(iph->saddr, iph->daddr, |
201 |
+- length_for_csum, iph->protocol, 0); |
202 |
++ length_for_csum, ipproto, 0); |
203 |
+ skb->csum = csum_sub(hw_checksum, csum_pseudo_header); |
204 |
++ return 0; |
205 |
+ } |
206 |
+ |
207 |
+ #if IS_ENABLED(CONFIG_IPV6) |
208 |
+@@ -744,17 +749,20 @@ static void get_fixed_ipv4_csum(__wsum hw_checksum, struct sk_buff *skb, |
209 |
+ static int get_fixed_ipv6_csum(__wsum hw_checksum, struct sk_buff *skb, |
210 |
+ struct ipv6hdr *ipv6h) |
211 |
+ { |
212 |
++ __u8 nexthdr = ipv6h->nexthdr; |
213 |
+ __wsum csum_pseudo_hdr = 0; |
214 |
+ |
215 |
+- if (unlikely(ipv6h->nexthdr == IPPROTO_FRAGMENT || |
216 |
+- ipv6h->nexthdr == IPPROTO_HOPOPTS)) |
217 |
++ if (unlikely(nexthdr == IPPROTO_FRAGMENT || |
218 |
++ nexthdr == IPPROTO_HOPOPTS || |
219 |
++ nexthdr == IPPROTO_SCTP)) |
220 |
+ return -1; |
221 |
+- hw_checksum = csum_add(hw_checksum, (__force __wsum)htons(ipv6h->nexthdr)); |
222 |
++ hw_checksum = csum_add(hw_checksum, (__force __wsum)htons(nexthdr)); |
223 |
+ |
224 |
+ csum_pseudo_hdr = csum_partial(&ipv6h->saddr, |
225 |
+ sizeof(ipv6h->saddr) + sizeof(ipv6h->daddr), 0); |
226 |
+ csum_pseudo_hdr = csum_add(csum_pseudo_hdr, (__force __wsum)ipv6h->payload_len); |
227 |
+- csum_pseudo_hdr = csum_add(csum_pseudo_hdr, (__force __wsum)ntohs(ipv6h->nexthdr)); |
228 |
++ csum_pseudo_hdr = csum_add(csum_pseudo_hdr, |
229 |
++ (__force __wsum)htons(nexthdr)); |
230 |
+ |
231 |
+ skb->csum = csum_sub(hw_checksum, csum_pseudo_hdr); |
232 |
+ skb->csum = csum_add(skb->csum, csum_partial(ipv6h, sizeof(struct ipv6hdr), 0)); |
233 |
+@@ -777,11 +785,10 @@ static int check_csum(struct mlx4_cqe *cqe, struct sk_buff *skb, void *va, |
234 |
+ } |
235 |
+ |
236 |
+ if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV4)) |
237 |
+- get_fixed_ipv4_csum(hw_checksum, skb, hdr); |
238 |
++ return get_fixed_ipv4_csum(hw_checksum, skb, hdr); |
239 |
+ #if IS_ENABLED(CONFIG_IPV6) |
240 |
+- else if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV6)) |
241 |
+- if (unlikely(get_fixed_ipv6_csum(hw_checksum, skb, hdr))) |
242 |
+- return -1; |
243 |
++ if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV6)) |
244 |
++ return get_fixed_ipv6_csum(hw_checksum, skb, hdr); |
245 |
+ #endif |
246 |
+ return 0; |
247 |
+ } |
248 |
+diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c |
249 |
+index 5489c0ec1d9a..96fa0e61d3af 100644 |
250 |
+--- a/drivers/net/ppp/ppp_generic.c |
251 |
++++ b/drivers/net/ppp/ppp_generic.c |
252 |
+@@ -119,6 +119,7 @@ struct ppp { |
253 |
+ int n_channels; /* how many channels are attached 54 */ |
254 |
+ spinlock_t rlock; /* lock for receive side 58 */ |
255 |
+ spinlock_t wlock; /* lock for transmit side 5c */ |
256 |
++ int *xmit_recursion __percpu; /* xmit recursion detect */ |
257 |
+ int mru; /* max receive unit 60 */ |
258 |
+ unsigned int flags; /* control bits 64 */ |
259 |
+ unsigned int xstate; /* transmit state bits 68 */ |
260 |
+@@ -1024,6 +1025,7 @@ static int ppp_dev_configure(struct net *src_net, struct net_device *dev, |
261 |
+ struct ppp *ppp = netdev_priv(dev); |
262 |
+ int indx; |
263 |
+ int err; |
264 |
++ int cpu; |
265 |
+ |
266 |
+ ppp->dev = dev; |
267 |
+ ppp->ppp_net = src_net; |
268 |
+@@ -1038,6 +1040,15 @@ static int ppp_dev_configure(struct net *src_net, struct net_device *dev, |
269 |
+ INIT_LIST_HEAD(&ppp->channels); |
270 |
+ spin_lock_init(&ppp->rlock); |
271 |
+ spin_lock_init(&ppp->wlock); |
272 |
++ |
273 |
++ ppp->xmit_recursion = alloc_percpu(int); |
274 |
++ if (!ppp->xmit_recursion) { |
275 |
++ err = -ENOMEM; |
276 |
++ goto err1; |
277 |
++ } |
278 |
++ for_each_possible_cpu(cpu) |
279 |
++ (*per_cpu_ptr(ppp->xmit_recursion, cpu)) = 0; |
280 |
++ |
281 |
+ #ifdef CONFIG_PPP_MULTILINK |
282 |
+ ppp->minseq = -1; |
283 |
+ skb_queue_head_init(&ppp->mrq); |
284 |
+@@ -1049,11 +1060,15 @@ static int ppp_dev_configure(struct net *src_net, struct net_device *dev, |
285 |
+ |
286 |
+ err = ppp_unit_register(ppp, conf->unit, conf->ifname_is_set); |
287 |
+ if (err < 0) |
288 |
+- return err; |
289 |
++ goto err2; |
290 |
+ |
291 |
+ conf->file->private_data = &ppp->file; |
292 |
+ |
293 |
+ return 0; |
294 |
++err2: |
295 |
++ free_percpu(ppp->xmit_recursion); |
296 |
++err1: |
297 |
++ return err; |
298 |
+ } |
299 |
+ |
300 |
+ static const struct nla_policy ppp_nl_policy[IFLA_PPP_MAX + 1] = { |
301 |
+@@ -1399,18 +1414,16 @@ static void __ppp_xmit_process(struct ppp *ppp) |
302 |
+ ppp_xmit_unlock(ppp); |
303 |
+ } |
304 |
+ |
305 |
+-static DEFINE_PER_CPU(int, ppp_xmit_recursion); |
306 |
+- |
307 |
+ static void ppp_xmit_process(struct ppp *ppp) |
308 |
+ { |
309 |
+ local_bh_disable(); |
310 |
+ |
311 |
+- if (unlikely(__this_cpu_read(ppp_xmit_recursion))) |
312 |
++ if (unlikely(*this_cpu_ptr(ppp->xmit_recursion))) |
313 |
+ goto err; |
314 |
+ |
315 |
+- __this_cpu_inc(ppp_xmit_recursion); |
316 |
++ (*this_cpu_ptr(ppp->xmit_recursion))++; |
317 |
+ __ppp_xmit_process(ppp); |
318 |
+- __this_cpu_dec(ppp_xmit_recursion); |
319 |
++ (*this_cpu_ptr(ppp->xmit_recursion))--; |
320 |
+ |
321 |
+ local_bh_enable(); |
322 |
+ |
323 |
+@@ -1901,23 +1914,23 @@ static void __ppp_channel_push(struct channel *pch) |
324 |
+ spin_unlock_bh(&pch->downl); |
325 |
+ /* see if there is anything from the attached unit to be sent */ |
326 |
+ if (skb_queue_empty(&pch->file.xq)) { |
327 |
+- read_lock_bh(&pch->upl); |
328 |
+ ppp = pch->ppp; |
329 |
+ if (ppp) |
330 |
+ __ppp_xmit_process(ppp); |
331 |
+- read_unlock_bh(&pch->upl); |
332 |
+ } |
333 |
+ } |
334 |
+ |
335 |
+ static void ppp_channel_push(struct channel *pch) |
336 |
+ { |
337 |
+- local_bh_disable(); |
338 |
+- |
339 |
+- __this_cpu_inc(ppp_xmit_recursion); |
340 |
+- __ppp_channel_push(pch); |
341 |
+- __this_cpu_dec(ppp_xmit_recursion); |
342 |
+- |
343 |
+- local_bh_enable(); |
344 |
++ read_lock_bh(&pch->upl); |
345 |
++ if (pch->ppp) { |
346 |
++ (*this_cpu_ptr(pch->ppp->xmit_recursion))++; |
347 |
++ __ppp_channel_push(pch); |
348 |
++ (*this_cpu_ptr(pch->ppp->xmit_recursion))--; |
349 |
++ } else { |
350 |
++ __ppp_channel_push(pch); |
351 |
++ } |
352 |
++ read_unlock_bh(&pch->upl); |
353 |
+ } |
354 |
+ |
355 |
+ /* |
356 |
+@@ -3056,6 +3069,7 @@ static void ppp_destroy_interface(struct ppp *ppp) |
357 |
+ #endif /* CONFIG_PPP_FILTER */ |
358 |
+ |
359 |
+ kfree_skb(ppp->xmit_pending); |
360 |
++ free_percpu(ppp->xmit_recursion); |
361 |
+ |
362 |
+ free_netdev(ppp->dev); |
363 |
+ } |
364 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
365 |
+index 0af019dfe846..1d0a7369d5a2 100644 |
366 |
+--- a/net/core/dev.c |
367 |
++++ b/net/core/dev.c |
368 |
+@@ -2703,7 +2703,7 @@ static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path) |
369 |
+ { |
370 |
+ if (tx_path) |
371 |
+ return skb->ip_summed != CHECKSUM_PARTIAL && |
372 |
+- skb->ip_summed != CHECKSUM_NONE; |
373 |
++ skb->ip_summed != CHECKSUM_UNNECESSARY; |
374 |
+ |
375 |
+ return skb->ip_summed == CHECKSUM_NONE; |
376 |
+ } |
377 |
+diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c |
378 |
+index f60fe82c2c1e..b5116ec31757 100644 |
379 |
+--- a/net/ipv4/af_inet.c |
380 |
++++ b/net/ipv4/af_inet.c |
381 |
+@@ -1693,6 +1693,13 @@ static __net_init int inet_init_net(struct net *net) |
382 |
+ net->ipv4.sysctl_ip_dynaddr = 0; |
383 |
+ net->ipv4.sysctl_ip_early_demux = 1; |
384 |
+ |
385 |
++ /* Some igmp sysctl, whose values are always used */ |
386 |
++ net->ipv4.sysctl_igmp_max_memberships = 20; |
387 |
++ net->ipv4.sysctl_igmp_max_msf = 10; |
388 |
++ /* IGMP reports for link-local multicast groups are enabled by default */ |
389 |
++ net->ipv4.sysctl_igmp_llm_reports = 1; |
390 |
++ net->ipv4.sysctl_igmp_qrv = 2; |
391 |
++ |
392 |
+ return 0; |
393 |
+ } |
394 |
+ |
395 |
+diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c |
396 |
+index 19930da56b0a..08575e3bd135 100644 |
397 |
+--- a/net/ipv4/igmp.c |
398 |
++++ b/net/ipv4/igmp.c |
399 |
+@@ -2974,12 +2974,6 @@ static int __net_init igmp_net_init(struct net *net) |
400 |
+ goto out_sock; |
401 |
+ } |
402 |
+ |
403 |
+- /* Sysctl initialization */ |
404 |
+- net->ipv4.sysctl_igmp_max_memberships = 20; |
405 |
+- net->ipv4.sysctl_igmp_max_msf = 10; |
406 |
+- /* IGMP reports for link-local multicast groups are enabled by default */ |
407 |
+- net->ipv4.sysctl_igmp_llm_reports = 1; |
408 |
+- net->ipv4.sysctl_igmp_qrv = 2; |
409 |
+ return 0; |
410 |
+ |
411 |
+ out_sock: |
412 |
+diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c |
413 |
+index 06215ba88b93..2c3c1a223df4 100644 |
414 |
+--- a/net/ipv4/ip_output.c |
415 |
++++ b/net/ipv4/ip_output.c |
416 |
+@@ -936,11 +936,12 @@ static int __ip_append_data(struct sock *sk, |
417 |
+ csummode = CHECKSUM_PARTIAL; |
418 |
+ |
419 |
+ cork->length += length; |
420 |
+- if ((((length + (skb ? skb->len : fragheaderlen)) > mtu) || |
421 |
+- (skb && skb_is_gso(skb))) && |
422 |
++ if ((skb && skb_is_gso(skb)) || |
423 |
++ ((length > mtu) && |
424 |
++ (skb_queue_len(queue) <= 1) && |
425 |
+ (sk->sk_protocol == IPPROTO_UDP) && |
426 |
+ (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && |
427 |
+- (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) { |
428 |
++ (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx)) { |
429 |
+ err = ip_ufo_append_data(sk, queue, getfrag, from, length, |
430 |
+ hh_len, fragheaderlen, transhdrlen, |
431 |
+ maxfraglen, flags); |
432 |
+@@ -1256,6 +1257,7 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, |
433 |
+ return -EINVAL; |
434 |
+ |
435 |
+ if ((size + skb->len > mtu) && |
436 |
++ (skb_queue_len(&sk->sk_write_queue) == 1) && |
437 |
+ (sk->sk_protocol == IPPROTO_UDP) && |
438 |
+ (rt->dst.dev->features & NETIF_F_UFO)) { |
439 |
+ if (skb->ip_summed != CHECKSUM_PARTIAL) |
440 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
441 |
+index 01336aa5f973..32c540145c17 100644 |
442 |
+--- a/net/ipv4/tcp_input.c |
443 |
++++ b/net/ipv4/tcp_input.c |
444 |
+@@ -2560,8 +2560,8 @@ static inline void tcp_end_cwnd_reduction(struct sock *sk) |
445 |
+ return; |
446 |
+ |
447 |
+ /* Reset cwnd to ssthresh in CWR or Recovery (unless it's undone) */ |
448 |
+- if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR || |
449 |
+- (tp->undo_marker && tp->snd_ssthresh < TCP_INFINITE_SSTHRESH)) { |
450 |
++ if (tp->snd_ssthresh < TCP_INFINITE_SSTHRESH && |
451 |
++ (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR || tp->undo_marker)) { |
452 |
+ tp->snd_cwnd = tp->snd_ssthresh; |
453 |
+ tp->snd_cwnd_stamp = tcp_time_stamp; |
454 |
+ } |
455 |
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c |
456 |
+index dc4258fd15dc..5d836b037442 100644 |
457 |
+--- a/net/ipv4/tcp_output.c |
458 |
++++ b/net/ipv4/tcp_output.c |
459 |
+@@ -3344,6 +3344,9 @@ int tcp_connect(struct sock *sk) |
460 |
+ struct sk_buff *buff; |
461 |
+ int err; |
462 |
+ |
463 |
++ if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk)) |
464 |
++ return -EHOSTUNREACH; /* Routing failure or similar. */ |
465 |
++ |
466 |
+ tcp_connect_init(sk); |
467 |
+ |
468 |
+ if (unlikely(tp->repair)) { |
469 |
+diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c |
470 |
+index b1e65b3b4361..74db43b47917 100644 |
471 |
+--- a/net/ipv4/tcp_timer.c |
472 |
++++ b/net/ipv4/tcp_timer.c |
473 |
+@@ -654,7 +654,8 @@ static void tcp_keepalive_timer (unsigned long data) |
474 |
+ goto death; |
475 |
+ } |
476 |
+ |
477 |
+- if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE) |
478 |
++ if (!sock_flag(sk, SOCK_KEEPOPEN) || |
479 |
++ ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_SYN_SENT))) |
480 |
+ goto out; |
481 |
+ |
482 |
+ elapsed = keepalive_time_when(tp); |
483 |
+diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c |
484 |
+index 5bab6c3f7a2f..4363b1e89bdf 100644 |
485 |
+--- a/net/ipv4/udp.c |
486 |
++++ b/net/ipv4/udp.c |
487 |
+@@ -813,7 +813,7 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4) |
488 |
+ if (is_udplite) /* UDP-Lite */ |
489 |
+ csum = udplite_csum(skb); |
490 |
+ |
491 |
+- else if (sk->sk_no_check_tx) { /* UDP csum disabled */ |
492 |
++ else if (sk->sk_no_check_tx && !skb_is_gso(skb)) { /* UDP csum off */ |
493 |
+ |
494 |
+ skb->ip_summed = CHECKSUM_NONE; |
495 |
+ goto send; |
496 |
+diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c |
497 |
+index b2be1d9757ef..6de016f80f17 100644 |
498 |
+--- a/net/ipv4/udp_offload.c |
499 |
++++ b/net/ipv4/udp_offload.c |
500 |
+@@ -232,7 +232,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, |
501 |
+ if (uh->check == 0) |
502 |
+ uh->check = CSUM_MANGLED_0; |
503 |
+ |
504 |
+- skb->ip_summed = CHECKSUM_NONE; |
505 |
++ skb->ip_summed = CHECKSUM_UNNECESSARY; |
506 |
+ |
507 |
+ /* If there is no outer header we can fake a checksum offload |
508 |
+ * due to the fact that we have already done the checksum in |
509 |
+diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c |
510 |
+index a5cdf2a23609..e0236e902ea7 100644 |
511 |
+--- a/net/ipv6/ip6_output.c |
512 |
++++ b/net/ipv6/ip6_output.c |
513 |
+@@ -1372,11 +1372,12 @@ static int __ip6_append_data(struct sock *sk, |
514 |
+ */ |
515 |
+ |
516 |
+ cork->length += length; |
517 |
+- if ((((length + (skb ? skb->len : headersize)) > mtu) || |
518 |
+- (skb && skb_is_gso(skb))) && |
519 |
++ if ((skb && skb_is_gso(skb)) || |
520 |
++ (((length + fragheaderlen) > mtu) && |
521 |
++ (skb_queue_len(queue) <= 1) && |
522 |
+ (sk->sk_protocol == IPPROTO_UDP) && |
523 |
+ (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && |
524 |
+- (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) { |
525 |
++ (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk))) { |
526 |
+ err = ip6_ufo_append_data(sk, queue, getfrag, from, length, |
527 |
+ hh_len, fragheaderlen, exthdrlen, |
528 |
+ transhdrlen, mtu, flags, fl6); |
529 |
+diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c |
530 |
+index a2267f80febb..e7d378c032cb 100644 |
531 |
+--- a/net/ipv6/udp_offload.c |
532 |
++++ b/net/ipv6/udp_offload.c |
533 |
+@@ -72,7 +72,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, |
534 |
+ if (uh->check == 0) |
535 |
+ uh->check = CSUM_MANGLED_0; |
536 |
+ |
537 |
+- skb->ip_summed = CHECKSUM_NONE; |
538 |
++ skb->ip_summed = CHECKSUM_UNNECESSARY; |
539 |
+ |
540 |
+ /* If there is no outer header we can fake a checksum offload |
541 |
+ * due to the fact that we have already done the checksum in |
542 |
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
543 |
+index 365c83fcee02..ae7bfd26cd91 100644 |
544 |
+--- a/net/packet/af_packet.c |
545 |
++++ b/net/packet/af_packet.c |
546 |
+@@ -3698,14 +3698,19 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv |
547 |
+ |
548 |
+ if (optlen != sizeof(val)) |
549 |
+ return -EINVAL; |
550 |
+- if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) |
551 |
+- return -EBUSY; |
552 |
+ if (copy_from_user(&val, optval, sizeof(val))) |
553 |
+ return -EFAULT; |
554 |
+ if (val > INT_MAX) |
555 |
+ return -EINVAL; |
556 |
+- po->tp_reserve = val; |
557 |
+- return 0; |
558 |
++ lock_sock(sk); |
559 |
++ if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) { |
560 |
++ ret = -EBUSY; |
561 |
++ } else { |
562 |
++ po->tp_reserve = val; |
563 |
++ ret = 0; |
564 |
++ } |
565 |
++ release_sock(sk); |
566 |
++ return ret; |
567 |
+ } |
568 |
+ case PACKET_LOSS: |
569 |
+ { |
570 |
+diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c |
571 |
+index 378c1c976058..a1aec0a6c789 100644 |
572 |
+--- a/net/sched/act_ipt.c |
573 |
++++ b/net/sched/act_ipt.c |
574 |
+@@ -49,8 +49,8 @@ static int ipt_init_target(struct xt_entry_target *t, char *table, |
575 |
+ return PTR_ERR(target); |
576 |
+ |
577 |
+ t->u.kernel.target = target; |
578 |
++ memset(&par, 0, sizeof(par)); |
579 |
+ par.table = table; |
580 |
+- par.entryinfo = NULL; |
581 |
+ par.target = target; |
582 |
+ par.targinfo = t->data; |
583 |
+ par.hook_mask = hook; |