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