1 |
commit: f283ce02a9f587f63f1eca6dfe00b0e30a5fd1ed |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 4 13:47:20 2017 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 4 13:47:20 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f283ce02 |
7 |
|
8 |
Linux patch 4.4.47 |
9 |
|
10 |
0000_README | 4 + |
11 |
1046_linux-4.4.47.patch | 576 ++++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 580 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index adfde9f..4286b42 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -227,6 +227,10 @@ Patch: 1045_linux-4.4.46.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.4.46 |
21 |
|
22 |
+Patch: 1046_linux-4.4.47.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.4.47 |
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/1046_linux-4.4.47.patch b/1046_linux-4.4.47.patch |
31 |
new file mode 100644 |
32 |
index 0000000..a822953 |
33 |
--- /dev/null |
34 |
+++ b/1046_linux-4.4.47.patch |
35 |
@@ -0,0 +1,576 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index 2dd5cb2fe182..7b233ac7f86c 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,6 +1,6 @@ |
41 |
+ VERSION = 4 |
42 |
+ PATCHLEVEL = 4 |
43 |
+-SUBLEVEL = 46 |
44 |
++SUBLEVEL = 47 |
45 |
+ EXTRAVERSION = |
46 |
+ NAME = Blurry Fish Butt |
47 |
+ |
48 |
+diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c |
49 |
+index 858106352ce9..8860e74aa28f 100644 |
50 |
+--- a/drivers/net/ethernet/broadcom/bcmsysport.c |
51 |
++++ b/drivers/net/ethernet/broadcom/bcmsysport.c |
52 |
+@@ -732,11 +732,8 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, |
53 |
+ unsigned int c_index, last_c_index, last_tx_cn, num_tx_cbs; |
54 |
+ unsigned int pkts_compl = 0, bytes_compl = 0; |
55 |
+ struct bcm_sysport_cb *cb; |
56 |
+- struct netdev_queue *txq; |
57 |
+ u32 hw_ind; |
58 |
+ |
59 |
+- txq = netdev_get_tx_queue(ndev, ring->index); |
60 |
+- |
61 |
+ /* Compute how many descriptors have been processed since last call */ |
62 |
+ hw_ind = tdma_readl(priv, TDMA_DESC_RING_PROD_CONS_INDEX(ring->index)); |
63 |
+ c_index = (hw_ind >> RING_CONS_INDEX_SHIFT) & RING_CONS_INDEX_MASK; |
64 |
+@@ -767,9 +764,6 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, |
65 |
+ |
66 |
+ ring->c_index = c_index; |
67 |
+ |
68 |
+- if (netif_tx_queue_stopped(txq) && pkts_compl) |
69 |
+- netif_tx_wake_queue(txq); |
70 |
+- |
71 |
+ netif_dbg(priv, tx_done, ndev, |
72 |
+ "ring=%d c_index=%d pkts_compl=%d, bytes_compl=%d\n", |
73 |
+ ring->index, ring->c_index, pkts_compl, bytes_compl); |
74 |
+@@ -781,16 +775,33 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, |
75 |
+ static unsigned int bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, |
76 |
+ struct bcm_sysport_tx_ring *ring) |
77 |
+ { |
78 |
++ struct netdev_queue *txq; |
79 |
+ unsigned int released; |
80 |
+ unsigned long flags; |
81 |
+ |
82 |
++ txq = netdev_get_tx_queue(priv->netdev, ring->index); |
83 |
++ |
84 |
+ spin_lock_irqsave(&ring->lock, flags); |
85 |
+ released = __bcm_sysport_tx_reclaim(priv, ring); |
86 |
++ if (released) |
87 |
++ netif_tx_wake_queue(txq); |
88 |
++ |
89 |
+ spin_unlock_irqrestore(&ring->lock, flags); |
90 |
+ |
91 |
+ return released; |
92 |
+ } |
93 |
+ |
94 |
++/* Locked version of the per-ring TX reclaim, but does not wake the queue */ |
95 |
++static void bcm_sysport_tx_clean(struct bcm_sysport_priv *priv, |
96 |
++ struct bcm_sysport_tx_ring *ring) |
97 |
++{ |
98 |
++ unsigned long flags; |
99 |
++ |
100 |
++ spin_lock_irqsave(&ring->lock, flags); |
101 |
++ __bcm_sysport_tx_reclaim(priv, ring); |
102 |
++ spin_unlock_irqrestore(&ring->lock, flags); |
103 |
++} |
104 |
++ |
105 |
+ static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget) |
106 |
+ { |
107 |
+ struct bcm_sysport_tx_ring *ring = |
108 |
+@@ -1275,7 +1286,7 @@ static void bcm_sysport_fini_tx_ring(struct bcm_sysport_priv *priv, |
109 |
+ napi_disable(&ring->napi); |
110 |
+ netif_napi_del(&ring->napi); |
111 |
+ |
112 |
+- bcm_sysport_tx_reclaim(priv, ring); |
113 |
++ bcm_sysport_tx_clean(priv, ring); |
114 |
+ |
115 |
+ kfree(ring->cbs); |
116 |
+ ring->cbs = NULL; |
117 |
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.h b/drivers/net/ethernet/mellanox/mlxsw/pci.h |
118 |
+index 142f33d978c5..a0fbe00dd690 100644 |
119 |
+--- a/drivers/net/ethernet/mellanox/mlxsw/pci.h |
120 |
++++ b/drivers/net/ethernet/mellanox/mlxsw/pci.h |
121 |
+@@ -206,21 +206,21 @@ MLXSW_ITEM32(pci, eqe, owner, 0x0C, 0, 1); |
122 |
+ /* pci_eqe_cmd_token |
123 |
+ * Command completion event - token |
124 |
+ */ |
125 |
+-MLXSW_ITEM32(pci, eqe, cmd_token, 0x08, 16, 16); |
126 |
++MLXSW_ITEM32(pci, eqe, cmd_token, 0x00, 16, 16); |
127 |
+ |
128 |
+ /* pci_eqe_cmd_status |
129 |
+ * Command completion event - status |
130 |
+ */ |
131 |
+-MLXSW_ITEM32(pci, eqe, cmd_status, 0x08, 0, 8); |
132 |
++MLXSW_ITEM32(pci, eqe, cmd_status, 0x00, 0, 8); |
133 |
+ |
134 |
+ /* pci_eqe_cmd_out_param_h |
135 |
+ * Command completion event - output parameter - higher part |
136 |
+ */ |
137 |
+-MLXSW_ITEM32(pci, eqe, cmd_out_param_h, 0x0C, 0, 32); |
138 |
++MLXSW_ITEM32(pci, eqe, cmd_out_param_h, 0x04, 0, 32); |
139 |
+ |
140 |
+ /* pci_eqe_cmd_out_param_l |
141 |
+ * Command completion event - output parameter - lower part |
142 |
+ */ |
143 |
+-MLXSW_ITEM32(pci, eqe, cmd_out_param_l, 0x10, 0, 32); |
144 |
++MLXSW_ITEM32(pci, eqe, cmd_out_param_l, 0x08, 0, 32); |
145 |
+ |
146 |
+ #endif |
147 |
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c |
148 |
+index 3be4a2355ead..cb165c2d4803 100644 |
149 |
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c |
150 |
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c |
151 |
+@@ -390,6 +390,7 @@ static netdev_tx_t mlxsw_sp_port_xmit(struct sk_buff *skb, |
152 |
+ dev_kfree_skb_any(skb_orig); |
153 |
+ return NETDEV_TX_OK; |
154 |
+ } |
155 |
++ dev_consume_skb_any(skb_orig); |
156 |
+ } |
157 |
+ |
158 |
+ if (eth_skb_pad(skb)) { |
159 |
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c |
160 |
+index d85960cfb694..fb2d9a82ce3d 100644 |
161 |
+--- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c |
162 |
++++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c |
163 |
+@@ -313,6 +313,7 @@ static netdev_tx_t mlxsw_sx_port_xmit(struct sk_buff *skb, |
164 |
+ dev_kfree_skb_any(skb_orig); |
165 |
+ return NETDEV_TX_OK; |
166 |
+ } |
167 |
++ dev_consume_skb_any(skb_orig); |
168 |
+ } |
169 |
+ mlxsw_sx_txhdr_construct(skb, &tx_info); |
170 |
+ len = skb->len; |
171 |
+diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c |
172 |
+index 467d41698fd5..549ad2018e7f 100644 |
173 |
+--- a/drivers/net/ethernet/renesas/ravb_main.c |
174 |
++++ b/drivers/net/ethernet/renesas/ravb_main.c |
175 |
+@@ -1330,6 +1330,19 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev) |
176 |
+ buffer = PTR_ALIGN(priv->tx_align[q], DPTR_ALIGN) + |
177 |
+ entry / NUM_TX_DESC * DPTR_ALIGN; |
178 |
+ len = PTR_ALIGN(skb->data, DPTR_ALIGN) - skb->data; |
179 |
++ /* Zero length DMA descriptors are problematic as they seem to |
180 |
++ * terminate DMA transfers. Avoid them by simply using a length of |
181 |
++ * DPTR_ALIGN (4) when skb data is aligned to DPTR_ALIGN. |
182 |
++ * |
183 |
++ * As skb is guaranteed to have at least ETH_ZLEN (60) bytes of |
184 |
++ * data by the call to skb_put_padto() above this is safe with |
185 |
++ * respect to both the length of the first DMA descriptor (len) |
186 |
++ * overflowing the available data and the length of the second DMA |
187 |
++ * descriptor (skb->len - len) being negative. |
188 |
++ */ |
189 |
++ if (len == 0) |
190 |
++ len = DPTR_ALIGN; |
191 |
++ |
192 |
+ memcpy(buffer, skb->data, len); |
193 |
+ dma_addr = dma_map_single(ndev->dev.parent, buffer, len, DMA_TO_DEVICE); |
194 |
+ if (dma_mapping_error(ndev->dev.parent, dma_addr)) |
195 |
+diff --git a/drivers/net/phy/bcm63xx.c b/drivers/net/phy/bcm63xx.c |
196 |
+index 86b28052bf06..9b709f78bb03 100644 |
197 |
+--- a/drivers/net/phy/bcm63xx.c |
198 |
++++ b/drivers/net/phy/bcm63xx.c |
199 |
+@@ -21,6 +21,23 @@ MODULE_DESCRIPTION("Broadcom 63xx internal PHY driver"); |
200 |
+ MODULE_AUTHOR("Maxime Bizon <mbizon@×××××××.fr>"); |
201 |
+ MODULE_LICENSE("GPL"); |
202 |
+ |
203 |
++static int bcm63xx_config_intr(struct phy_device *phydev) |
204 |
++{ |
205 |
++ int reg, err; |
206 |
++ |
207 |
++ reg = phy_read(phydev, MII_BCM63XX_IR); |
208 |
++ if (reg < 0) |
209 |
++ return reg; |
210 |
++ |
211 |
++ if (phydev->interrupts == PHY_INTERRUPT_ENABLED) |
212 |
++ reg &= ~MII_BCM63XX_IR_GMASK; |
213 |
++ else |
214 |
++ reg |= MII_BCM63XX_IR_GMASK; |
215 |
++ |
216 |
++ err = phy_write(phydev, MII_BCM63XX_IR, reg); |
217 |
++ return err; |
218 |
++} |
219 |
++ |
220 |
+ static int bcm63xx_config_init(struct phy_device *phydev) |
221 |
+ { |
222 |
+ int reg, err; |
223 |
+@@ -55,7 +72,7 @@ static struct phy_driver bcm63xx_driver[] = { |
224 |
+ .config_aneg = genphy_config_aneg, |
225 |
+ .read_status = genphy_read_status, |
226 |
+ .ack_interrupt = bcm_phy_ack_intr, |
227 |
+- .config_intr = bcm_phy_config_intr, |
228 |
++ .config_intr = bcm63xx_config_intr, |
229 |
+ .driver = { .owner = THIS_MODULE }, |
230 |
+ }, { |
231 |
+ /* same phy as above, with just a different OUI */ |
232 |
+@@ -68,7 +85,7 @@ static struct phy_driver bcm63xx_driver[] = { |
233 |
+ .config_aneg = genphy_config_aneg, |
234 |
+ .read_status = genphy_read_status, |
235 |
+ .ack_interrupt = bcm_phy_ack_intr, |
236 |
+- .config_intr = bcm_phy_config_intr, |
237 |
++ .config_intr = bcm63xx_config_intr, |
238 |
+ .driver = { .owner = THIS_MODULE }, |
239 |
+ } }; |
240 |
+ |
241 |
+diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c |
242 |
+index 7cba2c3759df..8c408aa2f208 100644 |
243 |
+--- a/drivers/net/usb/cdc_ether.c |
244 |
++++ b/drivers/net/usb/cdc_ether.c |
245 |
+@@ -462,6 +462,7 @@ static const struct driver_info wwan_info = { |
246 |
+ #define SAMSUNG_VENDOR_ID 0x04e8 |
247 |
+ #define LENOVO_VENDOR_ID 0x17ef |
248 |
+ #define NVIDIA_VENDOR_ID 0x0955 |
249 |
++#define HP_VENDOR_ID 0x03f0 |
250 |
+ |
251 |
+ static const struct usb_device_id products[] = { |
252 |
+ /* BLACKLIST !! |
253 |
+@@ -608,6 +609,13 @@ static const struct usb_device_id products[] = { |
254 |
+ .driver_info = 0, |
255 |
+ }, |
256 |
+ |
257 |
++/* HP lt2523 (Novatel E371) - handled by qmi_wwan */ |
258 |
++{ |
259 |
++ USB_DEVICE_AND_INTERFACE_INFO(HP_VENDOR_ID, 0x421d, USB_CLASS_COMM, |
260 |
++ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), |
261 |
++ .driver_info = 0, |
262 |
++}, |
263 |
++ |
264 |
+ /* AnyDATA ADU960S - handled by qmi_wwan */ |
265 |
+ { |
266 |
+ USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a, USB_CLASS_COMM, |
267 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
268 |
+index a34f491224c1..09052f9e324f 100644 |
269 |
+--- a/drivers/net/usb/qmi_wwan.c |
270 |
++++ b/drivers/net/usb/qmi_wwan.c |
271 |
+@@ -485,6 +485,13 @@ static const struct usb_device_id products[] = { |
272 |
+ USB_CDC_PROTO_NONE), |
273 |
+ .driver_info = (unsigned long)&qmi_wwan_info, |
274 |
+ }, |
275 |
++ { /* HP lt2523 (Novatel E371) */ |
276 |
++ USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d, |
277 |
++ USB_CLASS_COMM, |
278 |
++ USB_CDC_SUBCLASS_ETHERNET, |
279 |
++ USB_CDC_PROTO_NONE), |
280 |
++ .driver_info = (unsigned long)&qmi_wwan_info, |
281 |
++ }, |
282 |
+ { /* HP lt4112 LTE/HSPA+ Gobi 4G Module (Huawei me906e) */ |
283 |
+ USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7), |
284 |
+ .driver_info = (unsigned long)&qmi_wwan_info, |
285 |
+diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c |
286 |
+index 32b7ec976dcc..fbb1867ff25c 100644 |
287 |
+--- a/drivers/net/usb/r8152.c |
288 |
++++ b/drivers/net/usb/r8152.c |
289 |
+@@ -1645,7 +1645,7 @@ static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc) |
290 |
+ u8 checksum = CHECKSUM_NONE; |
291 |
+ u32 opts2, opts3; |
292 |
+ |
293 |
+- if (tp->version == RTL_VER_01) |
294 |
++ if (!(tp->netdev->features & NETIF_F_RXCSUM)) |
295 |
+ goto return_result; |
296 |
+ |
297 |
+ opts2 = le32_to_cpu(rx_desc->opts2); |
298 |
+@@ -3442,6 +3442,8 @@ static bool delay_autosuspend(struct r8152 *tp) |
299 |
+ */ |
300 |
+ if (!sw_linking && tp->rtl_ops.in_nway(tp)) |
301 |
+ return true; |
302 |
++ else if (!skb_queue_empty(&tp->tx_queue)) |
303 |
++ return true; |
304 |
+ else |
305 |
+ return false; |
306 |
+ } |
307 |
+@@ -4221,6 +4223,11 @@ static int rtl8152_probe(struct usb_interface *intf, |
308 |
+ NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | |
309 |
+ NETIF_F_IPV6_CSUM | NETIF_F_TSO6; |
310 |
+ |
311 |
++ if (tp->version == RTL_VER_01) { |
312 |
++ netdev->features &= ~NETIF_F_RXCSUM; |
313 |
++ netdev->hw_features &= ~NETIF_F_RXCSUM; |
314 |
++ } |
315 |
++ |
316 |
+ netdev->ethtool_ops = &ops; |
317 |
+ netif_set_gso_max_size(netdev, RTL_LIMITED_TSO_SIZE); |
318 |
+ |
319 |
+diff --git a/include/linux/tcp.h b/include/linux/tcp.h |
320 |
+index b386361ba3e8..318c24612458 100644 |
321 |
+--- a/include/linux/tcp.h |
322 |
++++ b/include/linux/tcp.h |
323 |
+@@ -56,8 +56,13 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb) |
324 |
+ |
325 |
+ /* TCP Fast Open Cookie as stored in memory */ |
326 |
+ struct tcp_fastopen_cookie { |
327 |
++ union { |
328 |
++ u8 val[TCP_FASTOPEN_COOKIE_MAX]; |
329 |
++#if IS_ENABLED(CONFIG_IPV6) |
330 |
++ struct in6_addr addr; |
331 |
++#endif |
332 |
++ }; |
333 |
+ s8 len; |
334 |
+- u8 val[TCP_FASTOPEN_COOKIE_MAX]; |
335 |
+ bool exp; /* In RFC6994 experimental option format */ |
336 |
+ }; |
337 |
+ |
338 |
+diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c |
339 |
+index 655a7d4c96e1..983f0b5e14f1 100644 |
340 |
+--- a/net/ax25/ax25_subr.c |
341 |
++++ b/net/ax25/ax25_subr.c |
342 |
+@@ -264,7 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason) |
343 |
+ { |
344 |
+ ax25_clear_queues(ax25); |
345 |
+ |
346 |
+- if (!sock_flag(ax25->sk, SOCK_DESTROY)) |
347 |
++ if (!ax25->sk || !sock_flag(ax25->sk, SOCK_DESTROY)) |
348 |
+ ax25_stop_heartbeat(ax25); |
349 |
+ ax25_stop_t1timer(ax25); |
350 |
+ ax25_stop_t2timer(ax25); |
351 |
+diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c |
352 |
+index 40197ff8918a..413d18e37083 100644 |
353 |
+--- a/net/bridge/br_netlink.c |
354 |
++++ b/net/bridge/br_netlink.c |
355 |
+@@ -773,20 +773,6 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[]) |
356 |
+ return 0; |
357 |
+ } |
358 |
+ |
359 |
+-static int br_dev_newlink(struct net *src_net, struct net_device *dev, |
360 |
+- struct nlattr *tb[], struct nlattr *data[]) |
361 |
+-{ |
362 |
+- struct net_bridge *br = netdev_priv(dev); |
363 |
+- |
364 |
+- if (tb[IFLA_ADDRESS]) { |
365 |
+- spin_lock_bh(&br->lock); |
366 |
+- br_stp_change_bridge_id(br, nla_data(tb[IFLA_ADDRESS])); |
367 |
+- spin_unlock_bh(&br->lock); |
368 |
+- } |
369 |
+- |
370 |
+- return register_netdevice(dev); |
371 |
+-} |
372 |
+- |
373 |
+ static int br_port_slave_changelink(struct net_device *brdev, |
374 |
+ struct net_device *dev, |
375 |
+ struct nlattr *tb[], |
376 |
+@@ -1068,6 +1054,25 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[], |
377 |
+ return 0; |
378 |
+ } |
379 |
+ |
380 |
++static int br_dev_newlink(struct net *src_net, struct net_device *dev, |
381 |
++ struct nlattr *tb[], struct nlattr *data[]) |
382 |
++{ |
383 |
++ struct net_bridge *br = netdev_priv(dev); |
384 |
++ int err; |
385 |
++ |
386 |
++ if (tb[IFLA_ADDRESS]) { |
387 |
++ spin_lock_bh(&br->lock); |
388 |
++ br_stp_change_bridge_id(br, nla_data(tb[IFLA_ADDRESS])); |
389 |
++ spin_unlock_bh(&br->lock); |
390 |
++ } |
391 |
++ |
392 |
++ err = br_changelink(dev, tb, data); |
393 |
++ if (err) |
394 |
++ return err; |
395 |
++ |
396 |
++ return register_netdevice(dev); |
397 |
++} |
398 |
++ |
399 |
+ static size_t br_get_size(const struct net_device *brdev) |
400 |
+ { |
401 |
+ return nla_total_size(sizeof(u32)) + /* IFLA_BR_FORWARD_DELAY */ |
402 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
403 |
+index 6f203c7fb166..0798a0f1b395 100644 |
404 |
+--- a/net/core/dev.c |
405 |
++++ b/net/core/dev.c |
406 |
+@@ -2650,9 +2650,9 @@ static netdev_features_t harmonize_features(struct sk_buff *skb, |
407 |
+ if (skb->ip_summed != CHECKSUM_NONE && |
408 |
+ !can_checksum_protocol(features, type)) { |
409 |
+ features &= ~NETIF_F_ALL_CSUM; |
410 |
+- } else if (illegal_highdma(skb->dev, skb)) { |
411 |
+- features &= ~NETIF_F_SG; |
412 |
+ } |
413 |
++ if (illegal_highdma(skb->dev, skb)) |
414 |
++ features &= ~NETIF_F_SG; |
415 |
+ |
416 |
+ return features; |
417 |
+ } |
418 |
+diff --git a/net/dsa/slave.c b/net/dsa/slave.c |
419 |
+index 7bc787b095c8..8dfe9fb7ad36 100644 |
420 |
+--- a/net/dsa/slave.c |
421 |
++++ b/net/dsa/slave.c |
422 |
+@@ -1101,6 +1101,8 @@ int dsa_slave_suspend(struct net_device *slave_dev) |
423 |
+ { |
424 |
+ struct dsa_slave_priv *p = netdev_priv(slave_dev); |
425 |
+ |
426 |
++ netif_device_detach(slave_dev); |
427 |
++ |
428 |
+ if (p->phy) { |
429 |
+ phy_stop(p->phy); |
430 |
+ p->old_pause = -1; |
431 |
+diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c |
432 |
+index 840b450aab46..67d44aa9e09f 100644 |
433 |
+--- a/net/ipv4/fib_semantics.c |
434 |
++++ b/net/ipv4/fib_semantics.c |
435 |
+@@ -1277,8 +1277,9 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event, |
436 |
+ nla_put_u32(skb, RTA_FLOW, fi->fib_nh[0].nh_tclassid)) |
437 |
+ goto nla_put_failure; |
438 |
+ #endif |
439 |
+- if (fi->fib_nh->nh_lwtstate) |
440 |
+- lwtunnel_fill_encap(skb, fi->fib_nh->nh_lwtstate); |
441 |
++ if (fi->fib_nh->nh_lwtstate && |
442 |
++ lwtunnel_fill_encap(skb, fi->fib_nh->nh_lwtstate) < 0) |
443 |
++ goto nla_put_failure; |
444 |
+ } |
445 |
+ #ifdef CONFIG_IP_ROUTE_MULTIPATH |
446 |
+ if (fi->fib_nhs > 1) { |
447 |
+@@ -1314,8 +1315,10 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event, |
448 |
+ nla_put_u32(skb, RTA_FLOW, nh->nh_tclassid)) |
449 |
+ goto nla_put_failure; |
450 |
+ #endif |
451 |
+- if (nh->nh_lwtstate) |
452 |
+- lwtunnel_fill_encap(skb, nh->nh_lwtstate); |
453 |
++ if (nh->nh_lwtstate && |
454 |
++ lwtunnel_fill_encap(skb, nh->nh_lwtstate) < 0) |
455 |
++ goto nla_put_failure; |
456 |
++ |
457 |
+ /* length of rtnetlink header + attributes */ |
458 |
+ rtnh->rtnh_len = nlmsg_get_pos(skb) - (void *) rtnh; |
459 |
+ } endfor_nexthops(fi); |
460 |
+diff --git a/net/ipv4/route.c b/net/ipv4/route.c |
461 |
+index 7ceb8a574a50..ef2f527a119b 100644 |
462 |
+--- a/net/ipv4/route.c |
463 |
++++ b/net/ipv4/route.c |
464 |
+@@ -2430,7 +2430,7 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src, u32 table_id, |
465 |
+ r->rtm_dst_len = 32; |
466 |
+ r->rtm_src_len = 0; |
467 |
+ r->rtm_tos = fl4->flowi4_tos; |
468 |
+- r->rtm_table = table_id; |
469 |
++ r->rtm_table = table_id < 256 ? table_id : RT_TABLE_COMPAT; |
470 |
+ if (nla_put_u32(skb, RTA_TABLE, table_id)) |
471 |
+ goto nla_put_failure; |
472 |
+ r->rtm_type = rt->rt_type; |
473 |
+diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c |
474 |
+index 55be6ac70cff..fca618272a01 100644 |
475 |
+--- a/net/ipv4/tcp_fastopen.c |
476 |
++++ b/net/ipv4/tcp_fastopen.c |
477 |
+@@ -112,7 +112,7 @@ static bool tcp_fastopen_cookie_gen(struct request_sock *req, |
478 |
+ struct tcp_fastopen_cookie tmp; |
479 |
+ |
480 |
+ if (__tcp_fastopen_cookie_gen(&ip6h->saddr, &tmp)) { |
481 |
+- struct in6_addr *buf = (struct in6_addr *) tmp.val; |
482 |
++ struct in6_addr *buf = &tmp.addr; |
483 |
+ int i; |
484 |
+ |
485 |
+ for (i = 0; i < 4; i++) |
486 |
+@@ -161,6 +161,7 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk, |
487 |
+ * scaled. So correct it appropriately. |
488 |
+ */ |
489 |
+ tp->snd_wnd = ntohs(tcp_hdr(skb)->window); |
490 |
++ tp->max_window = tp->snd_wnd; |
491 |
+ |
492 |
+ /* Activate the retrans timer so that SYNACK can be retransmitted. |
493 |
+ * The request socket is not added to the ehash |
494 |
+diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c |
495 |
+index cb8bb5988c03..253186a35567 100644 |
496 |
+--- a/net/ipv6/addrconf.c |
497 |
++++ b/net/ipv6/addrconf.c |
498 |
+@@ -5244,8 +5244,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf) |
499 |
+ struct net_device *dev; |
500 |
+ struct inet6_dev *idev; |
501 |
+ |
502 |
+- rcu_read_lock(); |
503 |
+- for_each_netdev_rcu(net, dev) { |
504 |
++ for_each_netdev(net, dev) { |
505 |
+ idev = __in6_dev_get(dev); |
506 |
+ if (idev) { |
507 |
+ int changed = (!idev->cnf.disable_ipv6) ^ (!newf); |
508 |
+@@ -5254,7 +5253,6 @@ static void addrconf_disable_change(struct net *net, __s32 newf) |
509 |
+ dev_disable_change(idev); |
510 |
+ } |
511 |
+ } |
512 |
+- rcu_read_unlock(); |
513 |
+ } |
514 |
+ |
515 |
+ static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf) |
516 |
+diff --git a/net/ipv6/route.c b/net/ipv6/route.c |
517 |
+index dbffc9de184b..36bf4c3fe4f5 100644 |
518 |
+--- a/net/ipv6/route.c |
519 |
++++ b/net/ipv6/route.c |
520 |
+@@ -3196,7 +3196,8 @@ static int rt6_fill_node(struct net *net, |
521 |
+ if (nla_put_u8(skb, RTA_PREF, IPV6_EXTRACT_PREF(rt->rt6i_flags))) |
522 |
+ goto nla_put_failure; |
523 |
+ |
524 |
+- lwtunnel_fill_encap(skb, rt->dst.lwtstate); |
525 |
++ if (lwtunnel_fill_encap(skb, rt->dst.lwtstate) < 0) |
526 |
++ goto nla_put_failure; |
527 |
+ |
528 |
+ nlmsg_end(skb, nlh); |
529 |
+ return 0; |
530 |
+diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c |
531 |
+index e004067ec24a..ad58d2a6284e 100644 |
532 |
+--- a/net/openvswitch/conntrack.c |
533 |
++++ b/net/openvswitch/conntrack.c |
534 |
+@@ -501,7 +501,7 @@ int ovs_ct_execute(struct net *net, struct sk_buff *skb, |
535 |
+ |
536 |
+ /* The conntrack module expects to be working at L3. */ |
537 |
+ nh_ofs = skb_network_offset(skb); |
538 |
+- skb_pull(skb, nh_ofs); |
539 |
++ skb_pull_rcsum(skb, nh_ofs); |
540 |
+ |
541 |
+ if (key->ip.frag != OVS_FRAG_TYPE_NONE) { |
542 |
+ err = handle_fragments(net, key, info->zone.id, skb); |
543 |
+@@ -527,6 +527,7 @@ int ovs_ct_execute(struct net *net, struct sk_buff *skb, |
544 |
+ &info->labels.mask); |
545 |
+ err: |
546 |
+ skb_push(skb, nh_ofs); |
547 |
++ skb_postpush_rcsum(skb, skb->data, nh_ofs); |
548 |
+ if (err) |
549 |
+ kfree_skb(skb); |
550 |
+ return err; |
551 |
+diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c |
552 |
+index 73f75258ce46..b2e934ff2448 100644 |
553 |
+--- a/net/unix/af_unix.c |
554 |
++++ b/net/unix/af_unix.c |
555 |
+@@ -994,6 +994,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
556 |
+ unsigned int hash; |
557 |
+ struct unix_address *addr; |
558 |
+ struct hlist_head *list; |
559 |
++ struct path path = { NULL, NULL }; |
560 |
+ |
561 |
+ err = -EINVAL; |
562 |
+ if (sunaddr->sun_family != AF_UNIX) |
563 |
+@@ -1009,9 +1010,20 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
564 |
+ goto out; |
565 |
+ addr_len = err; |
566 |
+ |
567 |
++ if (sun_path[0]) { |
568 |
++ umode_t mode = S_IFSOCK | |
569 |
++ (SOCK_INODE(sock)->i_mode & ~current_umask()); |
570 |
++ err = unix_mknod(sun_path, mode, &path); |
571 |
++ if (err) { |
572 |
++ if (err == -EEXIST) |
573 |
++ err = -EADDRINUSE; |
574 |
++ goto out; |
575 |
++ } |
576 |
++ } |
577 |
++ |
578 |
+ err = mutex_lock_interruptible(&u->bindlock); |
579 |
+ if (err) |
580 |
+- goto out; |
581 |
++ goto out_put; |
582 |
+ |
583 |
+ err = -EINVAL; |
584 |
+ if (u->addr) |
585 |
+@@ -1028,16 +1040,6 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
586 |
+ atomic_set(&addr->refcnt, 1); |
587 |
+ |
588 |
+ if (sun_path[0]) { |
589 |
+- struct path path; |
590 |
+- umode_t mode = S_IFSOCK | |
591 |
+- (SOCK_INODE(sock)->i_mode & ~current_umask()); |
592 |
+- err = unix_mknod(sun_path, mode, &path); |
593 |
+- if (err) { |
594 |
+- if (err == -EEXIST) |
595 |
+- err = -EADDRINUSE; |
596 |
+- unix_release_addr(addr); |
597 |
+- goto out_up; |
598 |
+- } |
599 |
+ addr->hash = UNIX_HASH_SIZE; |
600 |
+ hash = d_real_inode(path.dentry)->i_ino & (UNIX_HASH_SIZE - 1); |
601 |
+ spin_lock(&unix_table_lock); |
602 |
+@@ -1064,6 +1066,9 @@ out_unlock: |
603 |
+ spin_unlock(&unix_table_lock); |
604 |
+ out_up: |
605 |
+ mutex_unlock(&u->bindlock); |
606 |
++out_put: |
607 |
++ if (err) |
608 |
++ path_put(&path); |
609 |
+ out: |
610 |
+ return err; |
611 |
+ } |