1 |
commit: 29eec363a56cc46e3f5f2891fdacf07cd66d115d |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 23 14:40:32 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 23 14:40:32 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=29eec363 |
7 |
|
8 |
proj/linux-patches: Linux patch 4.4.176 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1175_linux-4.4.176.patch | 597 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 601 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index ac4792e..f0602c1 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -743,6 +743,10 @@ Patch: 1174_linux-4.4.175.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.4.175 |
23 |
|
24 |
+Patch: 1175_linux-4.4.176.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.4.176 |
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/1175_linux-4.4.176.patch b/1175_linux-4.4.176.patch |
33 |
new file mode 100644 |
34 |
index 0000000..1bac36a |
35 |
--- /dev/null |
36 |
+++ b/1175_linux-4.4.176.patch |
37 |
@@ -0,0 +1,597 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 5f0bdef2af99..d7a3b832e0fd 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 4 |
45 |
+-SUBLEVEL = 175 |
46 |
++SUBLEVEL = 176 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Blurry Fish Butt |
49 |
+ |
50 |
+diff --git a/arch/x86/kernel/livepatch.c b/arch/x86/kernel/livepatch.c |
51 |
+index d1d35ccffed3..579f8f813ce0 100644 |
52 |
+--- a/arch/x86/kernel/livepatch.c |
53 |
++++ b/arch/x86/kernel/livepatch.c |
54 |
+@@ -58,6 +58,7 @@ int klp_write_module_reloc(struct module *mod, unsigned long type, |
55 |
+ val = (s32)value; |
56 |
+ break; |
57 |
+ case R_X86_64_PC32: |
58 |
++ case R_X86_64_PLT32: |
59 |
+ val = (u32)(value - loc); |
60 |
+ break; |
61 |
+ default: |
62 |
+diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c |
63 |
+index aee2886a387c..14553f6c03a6 100644 |
64 |
+--- a/arch/x86/kvm/vmx.c |
65 |
++++ b/arch/x86/kvm/vmx.c |
66 |
+@@ -4628,7 +4628,9 @@ static u8 vmx_msr_bitmap_mode(struct kvm_vcpu *vcpu) |
67 |
+ { |
68 |
+ u8 mode = 0; |
69 |
+ |
70 |
+- if (irqchip_in_kernel(vcpu->kvm) && apic_x2apic_mode(vcpu->arch.apic)) { |
71 |
++ if (cpu_has_secondary_exec_ctrls() && |
72 |
++ (vmcs_read32(SECONDARY_VM_EXEC_CONTROL) & |
73 |
++ SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)) { |
74 |
+ mode |= MSR_BITMAP_MODE_X2APIC; |
75 |
+ if (enable_apicv) |
76 |
+ mode |= MSR_BITMAP_MODE_X2APIC_APICV; |
77 |
+diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c |
78 |
+index cb6606a0470d..be60bd5bab78 100644 |
79 |
+--- a/drivers/hwmon/lm80.c |
80 |
++++ b/drivers/hwmon/lm80.c |
81 |
+@@ -393,8 +393,10 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, |
82 |
+ } |
83 |
+ |
84 |
+ rv = lm80_read_value(client, LM80_REG_FANDIV); |
85 |
+- if (rv < 0) |
86 |
++ if (rv < 0) { |
87 |
++ mutex_unlock(&data->update_lock); |
88 |
+ return rv; |
89 |
++ } |
90 |
+ reg = (rv & ~(3 << (2 * (nr + 1)))) |
91 |
+ | (data->fan_div[nr] << (2 * (nr + 1))); |
92 |
+ lm80_write_value(client, LM80_REG_FANDIV, reg); |
93 |
+diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c |
94 |
+index 9438d7ec3308..8b29e97cf668 100644 |
95 |
+--- a/drivers/isdn/mISDN/timerdev.c |
96 |
++++ b/drivers/isdn/mISDN/timerdev.c |
97 |
+@@ -168,8 +168,8 @@ dev_expire_timer(unsigned long data) |
98 |
+ spin_lock_irqsave(&timer->dev->lock, flags); |
99 |
+ if (timer->id >= 0) |
100 |
+ list_move_tail(&timer->list, &timer->dev->expired); |
101 |
+- spin_unlock_irqrestore(&timer->dev->lock, flags); |
102 |
+ wake_up_interruptible(&timer->dev->wait); |
103 |
++ spin_unlock_irqrestore(&timer->dev->lock, flags); |
104 |
+ } |
105 |
+ |
106 |
+ static int |
107 |
+diff --git a/drivers/mfd/as3722.c b/drivers/mfd/as3722.c |
108 |
+index 924ea90494ae..e1f597f97f86 100644 |
109 |
+--- a/drivers/mfd/as3722.c |
110 |
++++ b/drivers/mfd/as3722.c |
111 |
+@@ -405,6 +405,8 @@ static int as3722_i2c_probe(struct i2c_client *i2c, |
112 |
+ goto scrub; |
113 |
+ } |
114 |
+ |
115 |
++ device_init_wakeup(as3722->dev, true); |
116 |
++ |
117 |
+ dev_dbg(as3722->dev, "AS3722 core driver initialized successfully\n"); |
118 |
+ return 0; |
119 |
+ |
120 |
+@@ -422,6 +424,29 @@ static int as3722_i2c_remove(struct i2c_client *i2c) |
121 |
+ return 0; |
122 |
+ } |
123 |
+ |
124 |
++static int __maybe_unused as3722_i2c_suspend(struct device *dev) |
125 |
++{ |
126 |
++ struct as3722 *as3722 = dev_get_drvdata(dev); |
127 |
++ |
128 |
++ if (device_may_wakeup(dev)) |
129 |
++ enable_irq_wake(as3722->chip_irq); |
130 |
++ disable_irq(as3722->chip_irq); |
131 |
++ |
132 |
++ return 0; |
133 |
++} |
134 |
++ |
135 |
++static int __maybe_unused as3722_i2c_resume(struct device *dev) |
136 |
++{ |
137 |
++ struct as3722 *as3722 = dev_get_drvdata(dev); |
138 |
++ |
139 |
++ enable_irq(as3722->chip_irq); |
140 |
++ |
141 |
++ if (device_may_wakeup(dev)) |
142 |
++ disable_irq_wake(as3722->chip_irq); |
143 |
++ |
144 |
++ return 0; |
145 |
++} |
146 |
++ |
147 |
+ static const struct of_device_id as3722_of_match[] = { |
148 |
+ { .compatible = "ams,as3722", }, |
149 |
+ {}, |
150 |
+@@ -434,10 +459,15 @@ static const struct i2c_device_id as3722_i2c_id[] = { |
151 |
+ }; |
152 |
+ MODULE_DEVICE_TABLE(i2c, as3722_i2c_id); |
153 |
+ |
154 |
++static const struct dev_pm_ops as3722_pm_ops = { |
155 |
++ SET_SYSTEM_SLEEP_PM_OPS(as3722_i2c_suspend, as3722_i2c_resume) |
156 |
++}; |
157 |
++ |
158 |
+ static struct i2c_driver as3722_i2c_driver = { |
159 |
+ .driver = { |
160 |
+ .name = "as3722", |
161 |
+ .of_match_table = as3722_of_match, |
162 |
++ .pm = &as3722_pm_ops, |
163 |
+ }, |
164 |
+ .probe = as3722_i2c_probe, |
165 |
+ .remove = as3722_i2c_remove, |
166 |
+diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c |
167 |
+index 6e5065f0907b..4b97aa24559a 100644 |
168 |
+--- a/drivers/net/ethernet/marvell/sky2.c |
169 |
++++ b/drivers/net/ethernet/marvell/sky2.c |
170 |
+@@ -5079,7 +5079,7 @@ static int sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
171 |
+ INIT_WORK(&hw->restart_work, sky2_restart); |
172 |
+ |
173 |
+ pci_set_drvdata(pdev, hw); |
174 |
+- pdev->d3_delay = 200; |
175 |
++ pdev->d3_delay = 300; |
176 |
+ |
177 |
+ return 0; |
178 |
+ |
179 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |
180 |
+index 2e51b816a7e8..fbf701e5f1e9 100644 |
181 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |
182 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |
183 |
+@@ -614,25 +614,27 @@ static int stmmac_ethtool_op_set_eee(struct net_device *dev, |
184 |
+ struct ethtool_eee *edata) |
185 |
+ { |
186 |
+ struct stmmac_priv *priv = netdev_priv(dev); |
187 |
++ int ret; |
188 |
+ |
189 |
+- priv->eee_enabled = edata->eee_enabled; |
190 |
+- |
191 |
+- if (!priv->eee_enabled) |
192 |
++ if (!edata->eee_enabled) { |
193 |
+ stmmac_disable_eee_mode(priv); |
194 |
+- else { |
195 |
++ } else { |
196 |
+ /* We are asking for enabling the EEE but it is safe |
197 |
+ * to verify all by invoking the eee_init function. |
198 |
+ * In case of failure it will return an error. |
199 |
+ */ |
200 |
+- priv->eee_enabled = stmmac_eee_init(priv); |
201 |
+- if (!priv->eee_enabled) |
202 |
++ edata->eee_enabled = stmmac_eee_init(priv); |
203 |
++ if (!edata->eee_enabled) |
204 |
+ return -EOPNOTSUPP; |
205 |
+- |
206 |
+- /* Do not change tx_lpi_timer in case of failure */ |
207 |
+- priv->tx_lpi_timer = edata->tx_lpi_timer; |
208 |
+ } |
209 |
+ |
210 |
+- return phy_ethtool_set_eee(priv->phydev, edata); |
211 |
++ ret = phy_ethtool_set_eee(dev->phydev, edata); |
212 |
++ if (ret) |
213 |
++ return ret; |
214 |
++ |
215 |
++ priv->eee_enabled = edata->eee_enabled; |
216 |
++ priv->tx_lpi_timer = edata->tx_lpi_timer; |
217 |
++ return 0; |
218 |
+ } |
219 |
+ |
220 |
+ static u32 stmmac_usec2riwt(u32 usec, struct stmmac_priv *priv) |
221 |
+diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c |
222 |
+index c41378214ede..553908adf3c5 100644 |
223 |
+--- a/drivers/net/vxlan.c |
224 |
++++ b/drivers/net/vxlan.c |
225 |
+@@ -1881,7 +1881,7 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan, |
226 |
+ struct pcpu_sw_netstats *tx_stats, *rx_stats; |
227 |
+ union vxlan_addr loopback; |
228 |
+ union vxlan_addr *remote_ip = &dst_vxlan->default_dst.remote_ip; |
229 |
+- struct net_device *dev = skb->dev; |
230 |
++ struct net_device *dev; |
231 |
+ int len = skb->len; |
232 |
+ |
233 |
+ tx_stats = this_cpu_ptr(src_vxlan->dev->tstats); |
234 |
+@@ -1901,8 +1901,15 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan, |
235 |
+ #endif |
236 |
+ } |
237 |
+ |
238 |
++ rcu_read_lock(); |
239 |
++ dev = skb->dev; |
240 |
++ if (unlikely(!(dev->flags & IFF_UP))) { |
241 |
++ kfree_skb(skb); |
242 |
++ goto drop; |
243 |
++ } |
244 |
++ |
245 |
+ if (dst_vxlan->flags & VXLAN_F_LEARN) |
246 |
+- vxlan_snoop(skb->dev, &loopback, eth_hdr(skb)->h_source); |
247 |
++ vxlan_snoop(dev, &loopback, eth_hdr(skb)->h_source); |
248 |
+ |
249 |
+ u64_stats_update_begin(&tx_stats->syncp); |
250 |
+ tx_stats->tx_packets++; |
251 |
+@@ -1915,8 +1922,10 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan, |
252 |
+ rx_stats->rx_bytes += len; |
253 |
+ u64_stats_update_end(&rx_stats->syncp); |
254 |
+ } else { |
255 |
++drop: |
256 |
+ dev->stats.rx_dropped++; |
257 |
+ } |
258 |
++ rcu_read_unlock(); |
259 |
+ } |
260 |
+ |
261 |
+ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, |
262 |
+diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h |
263 |
+index f0d87347df19..0508fcc67480 100644 |
264 |
+--- a/include/linux/netdev_features.h |
265 |
++++ b/include/linux/netdev_features.h |
266 |
+@@ -11,6 +11,8 @@ |
267 |
+ #define _LINUX_NETDEV_FEATURES_H |
268 |
+ |
269 |
+ #include <linux/types.h> |
270 |
++#include <linux/bitops.h> |
271 |
++#include <asm/byteorder.h> |
272 |
+ |
273 |
+ typedef u64 netdev_features_t; |
274 |
+ |
275 |
+@@ -125,8 +127,26 @@ enum { |
276 |
+ #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) |
277 |
+ #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) |
278 |
+ |
279 |
+-#define for_each_netdev_feature(mask_addr, bit) \ |
280 |
+- for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) |
281 |
++/* Finds the next feature with the highest number of the range of start till 0. |
282 |
++ */ |
283 |
++static inline int find_next_netdev_feature(u64 feature, unsigned long start) |
284 |
++{ |
285 |
++ /* like BITMAP_LAST_WORD_MASK() for u64 |
286 |
++ * this sets the most significant 64 - start to 0. |
287 |
++ */ |
288 |
++ feature &= ~0ULL >> (-start & ((sizeof(feature) * 8) - 1)); |
289 |
++ |
290 |
++ return fls64(feature) - 1; |
291 |
++} |
292 |
++ |
293 |
++/* This goes for the MSB to the LSB through the set feature bits, |
294 |
++ * mask_addr should be a u64 and bit an int |
295 |
++ */ |
296 |
++#define for_each_netdev_feature(mask_addr, bit) \ |
297 |
++ for ((bit) = find_next_netdev_feature((mask_addr), \ |
298 |
++ NETDEV_FEATURE_COUNT); \ |
299 |
++ (bit) >= 0; \ |
300 |
++ (bit) = find_next_netdev_feature((mask_addr), (bit) - 1)) |
301 |
+ |
302 |
+ /* Features valid for ethtool to change */ |
303 |
+ /* = all defined minus driver/device-class-related */ |
304 |
+diff --git a/include/net/ax25.h b/include/net/ax25.h |
305 |
+index e602f8177ebf..b507ce2b1952 100644 |
306 |
+--- a/include/net/ax25.h |
307 |
++++ b/include/net/ax25.h |
308 |
+@@ -199,6 +199,18 @@ static inline void ax25_hold_route(ax25_route *ax25_rt) |
309 |
+ |
310 |
+ void __ax25_put_route(ax25_route *ax25_rt); |
311 |
+ |
312 |
++extern rwlock_t ax25_route_lock; |
313 |
++ |
314 |
++static inline void ax25_route_lock_use(void) |
315 |
++{ |
316 |
++ read_lock(&ax25_route_lock); |
317 |
++} |
318 |
++ |
319 |
++static inline void ax25_route_lock_unuse(void) |
320 |
++{ |
321 |
++ read_unlock(&ax25_route_lock); |
322 |
++} |
323 |
++ |
324 |
+ static inline void ax25_put_route(ax25_route *ax25_rt) |
325 |
+ { |
326 |
+ if (atomic_dec_and_test(&ax25_rt->refcount)) |
327 |
+diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h |
328 |
+index 235c7811a86a..408d76f47bd2 100644 |
329 |
+--- a/include/net/inetpeer.h |
330 |
++++ b/include/net/inetpeer.h |
331 |
+@@ -40,6 +40,7 @@ struct inet_peer { |
332 |
+ |
333 |
+ u32 metrics[RTAX_MAX]; |
334 |
+ u32 rate_tokens; /* rate limiting for ICMP */ |
335 |
++ u32 n_redirects; |
336 |
+ unsigned long rate_last; |
337 |
+ union { |
338 |
+ struct list_head gc_list; |
339 |
+diff --git a/include/net/tcp.h b/include/net/tcp.h |
340 |
+index a99f75ef6a73..14ec97309581 100644 |
341 |
+--- a/include/net/tcp.h |
342 |
++++ b/include/net/tcp.h |
343 |
+@@ -1457,6 +1457,7 @@ static inline void tcp_write_queue_purge(struct sock *sk) |
344 |
+ sk_wmem_free_skb(sk, skb); |
345 |
+ sk_mem_reclaim(sk); |
346 |
+ tcp_clear_all_retrans_hints(tcp_sk(sk)); |
347 |
++ inet_csk(sk)->icsk_backoff = 0; |
348 |
+ } |
349 |
+ |
350 |
+ static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk) |
351 |
+diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c |
352 |
+index 2fa3be965101..cd9a24e5b97a 100644 |
353 |
+--- a/net/ax25/ax25_ip.c |
354 |
++++ b/net/ax25/ax25_ip.c |
355 |
+@@ -114,6 +114,7 @@ netdev_tx_t ax25_ip_xmit(struct sk_buff *skb) |
356 |
+ dst = (ax25_address *)(bp + 1); |
357 |
+ src = (ax25_address *)(bp + 8); |
358 |
+ |
359 |
++ ax25_route_lock_use(); |
360 |
+ route = ax25_get_route(dst, NULL); |
361 |
+ if (route) { |
362 |
+ digipeat = route->digipeat; |
363 |
+@@ -206,9 +207,8 @@ netdev_tx_t ax25_ip_xmit(struct sk_buff *skb) |
364 |
+ ax25_queue_xmit(skb, dev); |
365 |
+ |
366 |
+ put: |
367 |
+- if (route) |
368 |
+- ax25_put_route(route); |
369 |
+ |
370 |
++ ax25_route_lock_unuse(); |
371 |
+ return NETDEV_TX_OK; |
372 |
+ } |
373 |
+ |
374 |
+diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c |
375 |
+index d39097737e38..149f82bd83fd 100644 |
376 |
+--- a/net/ax25/ax25_route.c |
377 |
++++ b/net/ax25/ax25_route.c |
378 |
+@@ -40,7 +40,7 @@ |
379 |
+ #include <linux/export.h> |
380 |
+ |
381 |
+ static ax25_route *ax25_route_list; |
382 |
+-static DEFINE_RWLOCK(ax25_route_lock); |
383 |
++DEFINE_RWLOCK(ax25_route_lock); |
384 |
+ |
385 |
+ void ax25_rt_device_down(struct net_device *dev) |
386 |
+ { |
387 |
+@@ -349,6 +349,7 @@ const struct file_operations ax25_route_fops = { |
388 |
+ * Find AX.25 route |
389 |
+ * |
390 |
+ * Only routes with a reference count of zero can be destroyed. |
391 |
++ * Must be called with ax25_route_lock read locked. |
392 |
+ */ |
393 |
+ ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev) |
394 |
+ { |
395 |
+@@ -356,7 +357,6 @@ ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev) |
396 |
+ ax25_route *ax25_def_rt = NULL; |
397 |
+ ax25_route *ax25_rt; |
398 |
+ |
399 |
+- read_lock(&ax25_route_lock); |
400 |
+ /* |
401 |
+ * Bind to the physical interface we heard them on, or the default |
402 |
+ * route if none is found; |
403 |
+@@ -379,11 +379,6 @@ ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev) |
404 |
+ if (ax25_spe_rt != NULL) |
405 |
+ ax25_rt = ax25_spe_rt; |
406 |
+ |
407 |
+- if (ax25_rt != NULL) |
408 |
+- ax25_hold_route(ax25_rt); |
409 |
+- |
410 |
+- read_unlock(&ax25_route_lock); |
411 |
+- |
412 |
+ return ax25_rt; |
413 |
+ } |
414 |
+ |
415 |
+@@ -414,9 +409,12 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) |
416 |
+ ax25_route *ax25_rt; |
417 |
+ int err = 0; |
418 |
+ |
419 |
+- if ((ax25_rt = ax25_get_route(addr, NULL)) == NULL) |
420 |
++ ax25_route_lock_use(); |
421 |
++ ax25_rt = ax25_get_route(addr, NULL); |
422 |
++ if (!ax25_rt) { |
423 |
++ ax25_route_lock_unuse(); |
424 |
+ return -EHOSTUNREACH; |
425 |
+- |
426 |
++ } |
427 |
+ if ((ax25->ax25_dev = ax25_dev_ax25dev(ax25_rt->dev)) == NULL) { |
428 |
+ err = -EHOSTUNREACH; |
429 |
+ goto put; |
430 |
+@@ -451,8 +449,7 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) |
431 |
+ } |
432 |
+ |
433 |
+ put: |
434 |
+- ax25_put_route(ax25_rt); |
435 |
+- |
436 |
++ ax25_route_lock_unuse(); |
437 |
+ return err; |
438 |
+ } |
439 |
+ |
440 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
441 |
+index e03c1d2f6707..49f78bce5795 100644 |
442 |
+--- a/net/core/dev.c |
443 |
++++ b/net/core/dev.c |
444 |
+@@ -6421,7 +6421,7 @@ static netdev_features_t netdev_sync_upper_features(struct net_device *lower, |
445 |
+ netdev_features_t feature; |
446 |
+ int feature_bit; |
447 |
+ |
448 |
+- for_each_netdev_feature(&upper_disables, feature_bit) { |
449 |
++ for_each_netdev_feature(upper_disables, feature_bit) { |
450 |
+ feature = __NETIF_F_BIT(feature_bit); |
451 |
+ if (!(upper->wanted_features & feature) |
452 |
+ && (features & feature)) { |
453 |
+@@ -6441,7 +6441,7 @@ static void netdev_sync_lower_features(struct net_device *upper, |
454 |
+ netdev_features_t feature; |
455 |
+ int feature_bit; |
456 |
+ |
457 |
+- for_each_netdev_feature(&upper_disables, feature_bit) { |
458 |
++ for_each_netdev_feature(upper_disables, feature_bit) { |
459 |
+ feature = __NETIF_F_BIT(feature_bit); |
460 |
+ if (!(features & feature) && (lower->features & feature)) { |
461 |
+ netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n", |
462 |
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
463 |
+index fea7c24e99d0..2f63a90065e6 100644 |
464 |
+--- a/net/core/skbuff.c |
465 |
++++ b/net/core/skbuff.c |
466 |
+@@ -374,6 +374,8 @@ static void *__netdev_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) |
467 |
+ */ |
468 |
+ void *netdev_alloc_frag(unsigned int fragsz) |
469 |
+ { |
470 |
++ fragsz = SKB_DATA_ALIGN(fragsz); |
471 |
++ |
472 |
+ return __netdev_alloc_frag(fragsz, GFP_ATOMIC | __GFP_COLD); |
473 |
+ } |
474 |
+ EXPORT_SYMBOL(netdev_alloc_frag); |
475 |
+@@ -387,6 +389,8 @@ static void *__napi_alloc_frag(unsigned int fragsz, gfp_t gfp_mask) |
476 |
+ |
477 |
+ void *napi_alloc_frag(unsigned int fragsz) |
478 |
+ { |
479 |
++ fragsz = SKB_DATA_ALIGN(fragsz); |
480 |
++ |
481 |
+ return __napi_alloc_frag(fragsz, GFP_ATOMIC | __GFP_COLD); |
482 |
+ } |
483 |
+ EXPORT_SYMBOL(napi_alloc_frag); |
484 |
+diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c |
485 |
+index 86fa45809540..0c5862914f05 100644 |
486 |
+--- a/net/ipv4/inetpeer.c |
487 |
++++ b/net/ipv4/inetpeer.c |
488 |
+@@ -448,6 +448,7 @@ relookup: |
489 |
+ atomic_set(&p->rid, 0); |
490 |
+ p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW; |
491 |
+ p->rate_tokens = 0; |
492 |
++ p->n_redirects = 0; |
493 |
+ /* 60*HZ is arbitrary, but chosen enough high so that the first |
494 |
+ * calculation of tokens is at its maximum. |
495 |
+ */ |
496 |
+diff --git a/net/ipv4/route.c b/net/ipv4/route.c |
497 |
+index 3251dede1815..80ce6b0672d2 100644 |
498 |
+--- a/net/ipv4/route.c |
499 |
++++ b/net/ipv4/route.c |
500 |
+@@ -876,13 +876,15 @@ void ip_rt_send_redirect(struct sk_buff *skb) |
501 |
+ /* No redirected packets during ip_rt_redirect_silence; |
502 |
+ * reset the algorithm. |
503 |
+ */ |
504 |
+- if (time_after(jiffies, peer->rate_last + ip_rt_redirect_silence)) |
505 |
++ if (time_after(jiffies, peer->rate_last + ip_rt_redirect_silence)) { |
506 |
+ peer->rate_tokens = 0; |
507 |
++ peer->n_redirects = 0; |
508 |
++ } |
509 |
+ |
510 |
+ /* Too many ignored redirects; do not send anything |
511 |
+ * set dst.rate_last to the last seen redirected packet. |
512 |
+ */ |
513 |
+- if (peer->rate_tokens >= ip_rt_redirect_number) { |
514 |
++ if (peer->n_redirects >= ip_rt_redirect_number) { |
515 |
+ peer->rate_last = jiffies; |
516 |
+ goto out_put_peer; |
517 |
+ } |
518 |
+@@ -899,6 +901,7 @@ void ip_rt_send_redirect(struct sk_buff *skb) |
519 |
+ icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, gw); |
520 |
+ peer->rate_last = jiffies; |
521 |
+ ++peer->rate_tokens; |
522 |
++ ++peer->n_redirects; |
523 |
+ #ifdef CONFIG_IP_ROUTE_VERBOSE |
524 |
+ if (log_martians && |
525 |
+ peer->rate_tokens == ip_rt_redirect_number) |
526 |
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
527 |
+index b7492aabe710..f3a4d2dcbf7a 100644 |
528 |
+--- a/net/ipv4/tcp.c |
529 |
++++ b/net/ipv4/tcp.c |
530 |
+@@ -2253,7 +2253,6 @@ int tcp_disconnect(struct sock *sk, int flags) |
531 |
+ tp->write_seq += tp->max_window + 2; |
532 |
+ if (tp->write_seq == 0) |
533 |
+ tp->write_seq = 1; |
534 |
+- icsk->icsk_backoff = 0; |
535 |
+ tp->snd_cwnd = 2; |
536 |
+ icsk->icsk_probes_out = 0; |
537 |
+ tp->packets_out = 0; |
538 |
+diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c |
539 |
+index ee8399f11fd0..b3d6b8e77300 100644 |
540 |
+--- a/net/ipv4/tcp_ipv4.c |
541 |
++++ b/net/ipv4/tcp_ipv4.c |
542 |
+@@ -466,14 +466,15 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) |
543 |
+ if (sock_owned_by_user(sk)) |
544 |
+ break; |
545 |
+ |
546 |
++ skb = tcp_write_queue_head(sk); |
547 |
++ if (WARN_ON_ONCE(!skb)) |
548 |
++ break; |
549 |
++ |
550 |
+ icsk->icsk_backoff--; |
551 |
+ icsk->icsk_rto = tp->srtt_us ? __tcp_set_rto(tp) : |
552 |
+ TCP_TIMEOUT_INIT; |
553 |
+ icsk->icsk_rto = inet_csk_rto_backoff(icsk, TCP_RTO_MAX); |
554 |
+ |
555 |
+- skb = tcp_write_queue_head(sk); |
556 |
+- BUG_ON(!skb); |
557 |
+- |
558 |
+ remaining = icsk->icsk_rto - |
559 |
+ min(icsk->icsk_rto, |
560 |
+ tcp_time_stamp - tcp_skb_timestamp(skb)); |
561 |
+diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c |
562 |
+index 4dde1e0e7d37..086cdf9f0501 100644 |
563 |
+--- a/net/ipv6/addrconf.c |
564 |
++++ b/net/ipv6/addrconf.c |
565 |
+@@ -1043,7 +1043,8 @@ check_cleanup_prefix_route(struct inet6_ifaddr *ifp, unsigned long *expires) |
566 |
+ list_for_each_entry(ifa, &idev->addr_list, if_list) { |
567 |
+ if (ifa == ifp) |
568 |
+ continue; |
569 |
+- if (!ipv6_prefix_equal(&ifa->addr, &ifp->addr, |
570 |
++ if (ifa->prefix_len != ifp->prefix_len || |
571 |
++ !ipv6_prefix_equal(&ifa->addr, &ifp->addr, |
572 |
+ ifp->prefix_len)) |
573 |
+ continue; |
574 |
+ if (ifa->flags & (IFA_F_PERMANENT | IFA_F_NOPREFIXROUTE)) |
575 |
+diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c |
576 |
+index d24773552b64..217810674c35 100644 |
577 |
+--- a/net/vmw_vsock/vmci_transport.c |
578 |
++++ b/net/vmw_vsock/vmci_transport.c |
579 |
+@@ -1656,6 +1656,10 @@ static void vmci_transport_cleanup(struct work_struct *work) |
580 |
+ |
581 |
+ static void vmci_transport_destruct(struct vsock_sock *vsk) |
582 |
+ { |
583 |
++ /* transport can be NULL if we hit a failure at init() time */ |
584 |
++ if (!vmci_trans(vsk)) |
585 |
++ return; |
586 |
++ |
587 |
+ /* Ensure that the detach callback doesn't use the sk/vsk |
588 |
+ * we are about to destruct. |
589 |
+ */ |
590 |
+diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c |
591 |
+index c6ab4da4b8e2..8d7b2802d33f 100644 |
592 |
+--- a/net/x25/af_x25.c |
593 |
++++ b/net/x25/af_x25.c |
594 |
+@@ -352,17 +352,15 @@ static unsigned int x25_new_lci(struct x25_neigh *nb) |
595 |
+ unsigned int lci = 1; |
596 |
+ struct sock *sk; |
597 |
+ |
598 |
+- read_lock_bh(&x25_list_lock); |
599 |
+- |
600 |
+- while ((sk = __x25_find_socket(lci, nb)) != NULL) { |
601 |
++ while ((sk = x25_find_socket(lci, nb)) != NULL) { |
602 |
+ sock_put(sk); |
603 |
+ if (++lci == 4096) { |
604 |
+ lci = 0; |
605 |
+ break; |
606 |
+ } |
607 |
++ cond_resched(); |
608 |
+ } |
609 |
+ |
610 |
+- read_unlock_bh(&x25_list_lock); |
611 |
+ return lci; |
612 |
+ } |
613 |
+ |
614 |
+diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c |
615 |
+index e4be695eb789..fce48d11ae07 100644 |
616 |
+--- a/virt/kvm/kvm_main.c |
617 |
++++ b/virt/kvm/kvm_main.c |
618 |
+@@ -2711,14 +2711,15 @@ static int kvm_ioctl_create_device(struct kvm *kvm, |
619 |
+ return ret; |
620 |
+ } |
621 |
+ |
622 |
++ kvm_get_kvm(kvm); |
623 |
+ ret = anon_inode_getfd(ops->name, &kvm_device_fops, dev, O_RDWR | O_CLOEXEC); |
624 |
+ if (ret < 0) { |
625 |
++ kvm_put_kvm(kvm); |
626 |
+ ops->destroy(dev); |
627 |
+ return ret; |
628 |
+ } |
629 |
+ |
630 |
+ list_add(&dev->vm_node, &kvm->devices); |
631 |
+- kvm_get_kvm(kvm); |
632 |
+ cd->fd = ret; |
633 |
+ return 0; |
634 |
+ } |