diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-06 18:19:59 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-06 18:19:59 -0400 |
| commit | 442bb4bad90134e1c49ffb3ccdefca391ce05600 (patch) | |
| tree | 2e8796f8193001595e050909b482ac29cba0f1b0 | |
| parent | 9e441639d1ed78245600191f0fa45e106935a9dc (diff) | |
| parent | fde913e25496761a4e2a4c81230c913aba6289a2 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
1) In TCP, don't register an FRTO for cumulatively ACK'd data that was
previously SACK'd, from Neal Cardwell.
2) Need to hold RNL mutex in ipv4 multicast code namespace cleanup,
from Cong WANG.
3) Similarly we have to hold RNL mutex for fib_rules_unregister(), also
from Cong WANG.
4) Revert and rework netns nsid allocation fix, from Nicolas Dichtel.
5) When we encapsulate for a tunnel device, skb->sk still points to the
user socket. So this leads to cases where we retraverse the
ipv4/ipv6 output path with skb->sk being of some other address
family (f.e. AF_PACKET). This can cause things to crash since the
ipv4 output path is dereferencing an AF_PACKET socket as if it were
an ipv4 one.
The short term fix for 'net' and -stable is to elide these socket
checks once we've entered an encapsulation sequence by testing
xmit_recursion.
Longer term we have a better solution wherein we pass the tunnel's
socket down through the output paths, but that is way too invasive
for 'net' and -stable.
From Hannes Frederic Sowa.
6) l2tp_init() failure path forgets to unregister per-net ops, from
Cong WANG.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
net/mlx4_core: Fix error message deprecation for ConnectX-2 cards
net: dsa: fix filling routing table from OF description
l2tp: unregister l2tp_net_ops on failure path
mvneta: dont call mvneta_adjust_link() manually
ipv6: protect skb->sk accesses from recursive dereference inside the stack
netns: don't allocate an id for dead netns
Revert "netns: don't clear nsid too early on removal"
ip6mr: call del_timer_sync() in ip6mr_free_table()
net: move fib_rules_unregister() under rtnl lock
ipv4: take rtnl_lock and mark mrt table as freed on namespace cleanup
tcp: fix FRTO undo on cumulative ACK of SACKed range
xen-netfront: transmit fully GSO-sized packets
| -rw-r--r-- | Documentation/devicetree/bindings/net/dsa/dsa.txt | 4 | ||||
| -rw-r--r-- | drivers/net/ethernet/marvell/mvneta.c | 7 | ||||
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/cmd.c | 3 | ||||
| -rw-r--r-- | drivers/net/xen-netfront.c | 5 | ||||
| -rw-r--r-- | include/linux/netdevice.h | 6 | ||||
| -rw-r--r-- | include/net/ip.h | 16 | ||||
| -rw-r--r-- | include/net/ip6_route.h | 3 | ||||
| -rw-r--r-- | include/net/sock.h | 2 | ||||
| -rw-r--r-- | net/core/dev.c | 4 | ||||
| -rw-r--r-- | net/core/fib_rules.c | 2 | ||||
| -rw-r--r-- | net/core/net_namespace.c | 28 | ||||
| -rw-r--r-- | net/core/sock.c | 19 | ||||
| -rw-r--r-- | net/decnet/dn_rules.c | 2 | ||||
| -rw-r--r-- | net/dsa/dsa.c | 23 | ||||
| -rw-r--r-- | net/ipv4/fib_frontend.c | 3 | ||||
| -rw-r--r-- | net/ipv4/ipmr.c | 5 | ||||
| -rw-r--r-- | net/ipv4/tcp_input.c | 7 | ||||
| -rw-r--r-- | net/ipv6/fib6_rules.c | 2 | ||||
| -rw-r--r-- | net/ipv6/ip6_output.c | 3 | ||||
| -rw-r--r-- | net/ipv6/ip6mr.c | 4 | ||||
| -rw-r--r-- | net/l2tp/l2tp_core.c | 1 |
21 files changed, 78 insertions, 71 deletions
diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.txt b/Documentation/devicetree/bindings/net/dsa/dsa.txt index e124847443f8..f0b4cd72411d 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.txt +++ b/Documentation/devicetree/bindings/net/dsa/dsa.txt | |||
| @@ -19,7 +19,9 @@ the parent DSA node. The maximum number of allowed child nodes is 4 | |||
| 19 | (DSA_MAX_SWITCHES). | 19 | (DSA_MAX_SWITCHES). |
| 20 | Each of these switch child nodes should have the following required properties: | 20 | Each of these switch child nodes should have the following required properties: |
| 21 | 21 | ||
| 22 | - reg : Describes the switch address on the MII bus | 22 | - reg : Contains two fields. The first one describes the |
| 23 | address on the MII bus. The second is the switch | ||
| 24 | number that must be unique in cascaded configurations | ||
| 23 | - #address-cells : Must be 1 | 25 | - #address-cells : Must be 1 |
| 24 | - #size-cells : Must be 0 | 26 | - #size-cells : Must be 0 |
| 25 | 27 | ||
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 96208f17bb53..2db653225a0e 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
| @@ -2658,16 +2658,11 @@ static int mvneta_stop(struct net_device *dev) | |||
| 2658 | static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 2658 | static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) |
| 2659 | { | 2659 | { |
| 2660 | struct mvneta_port *pp = netdev_priv(dev); | 2660 | struct mvneta_port *pp = netdev_priv(dev); |
| 2661 | int ret; | ||
| 2662 | 2661 | ||
| 2663 | if (!pp->phy_dev) | 2662 | if (!pp->phy_dev) |
| 2664 | return -ENOTSUPP; | 2663 | return -ENOTSUPP; |
| 2665 | 2664 | ||
| 2666 | ret = phy_mii_ioctl(pp->phy_dev, ifr, cmd); | 2665 | return phy_mii_ioctl(pp->phy_dev, ifr, cmd); |
| 2667 | if (!ret) | ||
| 2668 | mvneta_adjust_link(dev); | ||
| 2669 | |||
| 2670 | return ret; | ||
| 2671 | } | 2666 | } |
| 2672 | 2667 | ||
| 2673 | /* Ethtool methods */ | 2668 | /* Ethtool methods */ |
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 3350721bf515..546ca4226916 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c | |||
| @@ -724,7 +724,8 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param, | |||
| 724 | * on the host, we deprecate the error message for this | 724 | * on the host, we deprecate the error message for this |
| 725 | * specific command/input_mod/opcode_mod/fw-status to be debug. | 725 | * specific command/input_mod/opcode_mod/fw-status to be debug. |
| 726 | */ | 726 | */ |
| 727 | if (op == MLX4_CMD_SET_PORT && in_modifier == 1 && | 727 | if (op == MLX4_CMD_SET_PORT && |
| 728 | (in_modifier == 1 || in_modifier == 2) && | ||
| 728 | op_modifier == 0 && context->fw_status == CMD_STAT_BAD_SIZE) | 729 | op_modifier == 0 && context->fw_status == CMD_STAT_BAD_SIZE) |
| 729 | mlx4_dbg(dev, "command 0x%x failed: fw status = 0x%x\n", | 730 | mlx4_dbg(dev, "command 0x%x failed: fw status = 0x%x\n", |
| 730 | op, context->fw_status); | 731 | op, context->fw_status); |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index e9b960f0ff32..720aaf6313d2 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
| @@ -1008,8 +1008,7 @@ err: | |||
| 1008 | 1008 | ||
| 1009 | static int xennet_change_mtu(struct net_device *dev, int mtu) | 1009 | static int xennet_change_mtu(struct net_device *dev, int mtu) |
| 1010 | { | 1010 | { |
| 1011 | int max = xennet_can_sg(dev) ? | 1011 | int max = xennet_can_sg(dev) ? XEN_NETIF_MAX_TX_SIZE : ETH_DATA_LEN; |
| 1012 | XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER : ETH_DATA_LEN; | ||
| 1013 | 1012 | ||
| 1014 | if (mtu > max) | 1013 | if (mtu > max) |
| 1015 | return -EINVAL; | 1014 | return -EINVAL; |
| @@ -1279,8 +1278,6 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) | |||
| 1279 | netdev->ethtool_ops = &xennet_ethtool_ops; | 1278 | netdev->ethtool_ops = &xennet_ethtool_ops; |
| 1280 | SET_NETDEV_DEV(netdev, &dev->dev); | 1279 | SET_NETDEV_DEV(netdev, &dev->dev); |
| 1281 | 1280 | ||
| 1282 | netif_set_gso_max_size(netdev, XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER); | ||
| 1283 | |||
| 1284 | np->netdev = netdev; | 1281 | np->netdev = netdev; |
| 1285 | 1282 | ||
| 1286 | netif_carrier_off(netdev); | 1283 | netif_carrier_off(netdev); |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index dcf6ec27739b..278738873703 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2185,6 +2185,12 @@ void netdev_freemem(struct net_device *dev); | |||
| 2185 | void synchronize_net(void); | 2185 | void synchronize_net(void); |
| 2186 | int init_dummy_netdev(struct net_device *dev); | 2186 | int init_dummy_netdev(struct net_device *dev); |
| 2187 | 2187 | ||
| 2188 | DECLARE_PER_CPU(int, xmit_recursion); | ||
| 2189 | static inline int dev_recursion_level(void) | ||
| 2190 | { | ||
| 2191 | return this_cpu_read(xmit_recursion); | ||
| 2192 | } | ||
| 2193 | |||
| 2188 | struct net_device *dev_get_by_index(struct net *net, int ifindex); | 2194 | struct net_device *dev_get_by_index(struct net *net, int ifindex); |
| 2189 | struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 2195 | struct net_device *__dev_get_by_index(struct net *net, int ifindex); |
| 2190 | struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); | 2196 | struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); |
diff --git a/include/net/ip.h b/include/net/ip.h index 025c61c0dffb..6cc1eafb153a 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -453,22 +453,6 @@ static __inline__ void inet_reset_saddr(struct sock *sk) | |||
| 453 | 453 | ||
| 454 | #endif | 454 | #endif |
| 455 | 455 | ||
| 456 | static inline int sk_mc_loop(struct sock *sk) | ||
| 457 | { | ||
| 458 | if (!sk) | ||
| 459 | return 1; | ||
| 460 | switch (sk->sk_family) { | ||
| 461 | case AF_INET: | ||
| 462 | return inet_sk(sk)->mc_loop; | ||
| 463 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 464 | case AF_INET6: | ||
| 465 | return inet6_sk(sk)->mc_loop; | ||
| 466 | #endif | ||
| 467 | } | ||
| 468 | WARN_ON(1); | ||
| 469 | return 1; | ||
| 470 | } | ||
| 471 | |||
| 472 | bool ip_call_ra_chain(struct sk_buff *skb); | 456 | bool ip_call_ra_chain(struct sk_buff *skb); |
| 473 | 457 | ||
| 474 | /* | 458 | /* |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 1d09b46c1e48..eda131d179d9 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -174,7 +174,8 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | |||
| 174 | 174 | ||
| 175 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | 175 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) |
| 176 | { | 176 | { |
| 177 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | 177 | struct ipv6_pinfo *np = skb->sk && !dev_recursion_level() ? |
| 178 | inet6_sk(skb->sk) : NULL; | ||
| 178 | 179 | ||
| 179 | return (np && np->pmtudisc >= IPV6_PMTUDISC_PROBE) ? | 180 | return (np && np->pmtudisc >= IPV6_PMTUDISC_PROBE) ? |
| 180 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 181 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); |
diff --git a/include/net/sock.h b/include/net/sock.h index ab186b1d31ff..e4079c28e6b8 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -1762,6 +1762,8 @@ struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); | |||
| 1762 | 1762 | ||
| 1763 | struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); | 1763 | struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie); |
| 1764 | 1764 | ||
| 1765 | bool sk_mc_loop(struct sock *sk); | ||
| 1766 | |||
| 1765 | static inline bool sk_can_gso(const struct sock *sk) | 1767 | static inline bool sk_can_gso(const struct sock *sk) |
| 1766 | { | 1768 | { |
| 1767 | return net_gso_ok(sk->sk_route_caps, sk->sk_gso_type); | 1769 | return |
