From: Greg Kroah-Hartman Date: Sun, 14 Dec 2014 16:46:22 +0000 (-0800) Subject: 3.14-stable patches X-Git-Tag: v3.10.63~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4af7e3b79b6dd7ea2a80a4c34cb9fc32cfaf4c07;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: fix-race-condition-between-vxlan_sock_add-and-vxlan_sock_release.patch gre-set-inner-mac-header-in-gro-complete.patch ip_tunnel-the-lack-of-vti_link_ops-dellink-cause-kernel-panic.patch ipv6-gre-fix-wrong-skb-protocol-in-wccp.patch net-mlx4_core-limit-count-field-to-24-bits-in-qp_alloc_res.patch net-mvneta-fix-race-condition-in-mvneta_tx.patch net-mvneta-fix-tx-interrupt-delay.patch net-sctp-use-max_header-for-headroom-reserve-in-output-path.patch rtnetlink-release-net-refcnt-on-error-in-do_setlink.patch tg3-fix-ring-init-when-there-are-more-tx-than-rx-channels.patch --- diff --git a/queue-3.14/fix-race-condition-between-vxlan_sock_add-and-vxlan_sock_release.patch b/queue-3.14/fix-race-condition-between-vxlan_sock_add-and-vxlan_sock_release.patch new file mode 100644 index 00000000000..f9f9be3f381 --- /dev/null +++ b/queue-3.14/fix-race-condition-between-vxlan_sock_add-and-vxlan_sock_release.patch @@ -0,0 +1,72 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: Marcelo Leitner +Date: Thu, 11 Dec 2014 10:02:22 -0200 +Subject: Fix race condition between vxlan_sock_add and vxlan_sock_release + +From: Marcelo Leitner + +[ Upstream commit 00c83b01d58068dfeb2e1351cca6fccf2a83fa8f ] + +Currently, when trying to reuse a socket, vxlan_sock_add will grab +vn->sock_lock, locate a reusable socket, inc refcount and release +vn->sock_lock. + +But vxlan_sock_release() will first decrement refcount, and then grab +that lock. refcnt operations are atomic but as currently we have +deferred works which hold vs->refcnt each, this might happen, leading to +a use after free (specially after vxlan_igmp_leave): + + CPU 1 CPU 2 + +deferred work vxlan_sock_add + ... ... + spin_lock(&vn->sock_lock) + vs = vxlan_find_sock(); + vxlan_sock_release + dec vs->refcnt, reaches 0 + spin_lock(&vn->sock_lock) + vxlan_sock_hold(vs), refcnt=1 + spin_unlock(&vn->sock_lock) + hlist_del_rcu(&vs->hlist); + vxlan_notify_del_rx_port(vs) + spin_unlock(&vn->sock_lock) + +So when we look for a reusable socket, we check if it wasn't freed +already before reusing it. + +Signed-off-by: Marcelo Ricardo Leitner +Fixes: 7c47cedf43a8b3 ("vxlan: move IGMP join/leave to work queue") +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/vxlan.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/drivers/net/vxlan.c ++++ b/drivers/net/vxlan.c +@@ -2106,9 +2106,8 @@ static int vxlan_init(struct net_device + spin_lock(&vn->sock_lock); + vs = vxlan_find_sock(dev_net(dev), ipv6 ? AF_INET6 : AF_INET, + vxlan->dst_port); +- if (vs) { ++ if (vs && atomic_add_unless(&vs->refcnt, 1, 0)) { + /* If we have a socket with same port already, reuse it */ +- atomic_inc(&vs->refcnt); + vxlan_vs_add_dev(vs, vxlan); + } else { + /* otherwise make new socket outside of RTNL */ +@@ -2574,12 +2573,9 @@ struct vxlan_sock *vxlan_sock_add(struct + + spin_lock(&vn->sock_lock); + vs = vxlan_find_sock(net, ipv6 ? AF_INET6 : AF_INET, port); +- if (vs) { +- if (vs->rcv == rcv) +- atomic_inc(&vs->refcnt); +- else ++ if (vs && ((vs->rcv != rcv) || ++ !atomic_add_unless(&vs->refcnt, 1, 0))) + vs = ERR_PTR(-EBUSY); +- } + spin_unlock(&vn->sock_lock); + + if (!vs) diff --git a/queue-3.14/gre-set-inner-mac-header-in-gro-complete.patch b/queue-3.14/gre-set-inner-mac-header-in-gro-complete.patch new file mode 100644 index 00000000000..a47b27e3688 --- /dev/null +++ b/queue-3.14/gre-set-inner-mac-header-in-gro-complete.patch @@ -0,0 +1,36 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: Tom Herbert +Date: Sat, 29 Nov 2014 09:59:45 -0800 +Subject: gre: Set inner mac header in gro complete + +From: Tom Herbert + +[ Upstream commit 6fb2a756739aa507c1fd5b8126f0bfc2f070dc46 ] + +Set the inner mac header to point to the GRE payload when +doing GRO. This is needed if we proceed to send the packet +through GRE GSO which now uses the inner mac header instead +of inner network header to determine the length of encapsulation +headers. + +Fixes: 14051f0452a2 ("gre: Use inner mac length when computing tunnel length") +Reported-by: Wolfgang Walter +Signed-off-by: Tom Herbert +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/gre_offload.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/ipv4/gre_offload.c ++++ b/net/ipv4/gre_offload.c +@@ -271,6 +271,9 @@ static int gre_gro_complete(struct sk_bu + err = ptype->callbacks.gro_complete(skb, nhoff + grehlen); + + rcu_read_unlock(); ++ ++ skb_set_inner_mac_header(skb, nhoff + grehlen); ++ + return err; + } + diff --git a/queue-3.14/ip_tunnel-the-lack-of-vti_link_ops-dellink-cause-kernel-panic.patch b/queue-3.14/ip_tunnel-the-lack-of-vti_link_ops-dellink-cause-kernel-panic.patch new file mode 100644 index 00000000000..d99f2e7184e --- /dev/null +++ b/queue-3.14/ip_tunnel-the-lack-of-vti_link_ops-dellink-cause-kernel-panic.patch @@ -0,0 +1,109 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: lucien +Date: Sun, 23 Nov 2014 15:04:11 +0800 +Subject: ip_tunnel: the lack of vti_link_ops' dellink() cause kernel panic + +From: lucien + +[ Upstream commit 20ea60ca9952bd19d4b0d74719daba305aef5178 ] + +Now the vti_link_ops do not point the .dellink, for fb tunnel device +(ip_vti0), the net_device will be removed as the default .dellink is +unregister_netdevice_queue,but the tunnel still in the tunnel list, +then if we add a new vti tunnel, in ip_tunnel_find(): + + hlist_for_each_entry_rcu(t, head, hash_node) { + if (local == t->parms.iph.saddr && + remote == t->parms.iph.daddr && + link == t->parms.link && +==> type == t->dev->type && + ip_tunnel_key_match(&t->parms, flags, key)) + break; + } + +the panic will happen, cause dev of ip_tunnel *t is null: +[ 3835.072977] IP: [] ip_tunnel_find+0x9d/0xc0 [ip_tunnel] +[ 3835.073008] PGD b2c21067 PUD b7277067 PMD 0 +[ 3835.073008] Oops: 0000 [#1] SMP +..... +[ 3835.073008] Stack: +[ 3835.073008] ffff8800b72d77f0 ffffffffa0411924 ffff8800bb956000 ffff8800b72d78e0 +[ 3835.073008] ffff8800b72d78a0 0000000000000000 ffffffffa040d100 ffff8800b72d7858 +[ 3835.073008] ffffffffa040b2e3 0000000000000000 0000000000000000 0000000000000000 +[ 3835.073008] Call Trace: +[ 3835.073008] [] ip_tunnel_newlink+0x64/0x160 [ip_tunnel] +[ 3835.073008] [] vti_newlink+0x43/0x70 [ip_vti] +[ 3835.073008] [] rtnl_newlink+0x4fa/0x5f0 +[ 3835.073008] [] ? nla_strlcpy+0x5b/0x70 +[ 3835.073008] [] ? rtnl_link_ops_get+0x40/0x60 +[ 3835.073008] [] ? rtnl_newlink+0x13f/0x5f0 +[ 3835.073008] [] rtnetlink_rcv_msg+0xa4/0x270 +[ 3835.073008] [] ? sock_has_perm+0x75/0x90 +[ 3835.073008] [] ? rtnetlink_rcv+0x30/0x30 +[ 3835.073008] [] netlink_rcv_skb+0xa9/0xc0 +[ 3835.073008] [] rtnetlink_rcv+0x28/0x30 +.... + +modprobe ip_vti +ip link del ip_vti0 type vti +ip link add ip_vti0 type vti +rmmod ip_vti + +do that one or more times, kernel will panic. + +fix it by assigning ip_tunnel_dellink to vti_link_ops' dellink, in +which we skip the unregister of fb tunnel device. do the same on ip6_vti. + +Signed-off-by: Xin Long +Signed-off-by: Cong Wang +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/ip_vti.c | 1 + + net/ipv6/ip6_vti.c | 11 +++++++++++ + 2 files changed, 12 insertions(+) + +--- a/net/ipv4/ip_vti.c ++++ b/net/ipv4/ip_vti.c +@@ -369,6 +369,7 @@ static struct rtnl_link_ops vti_link_ops + .validate = vti_tunnel_validate, + .newlink = vti_newlink, + .changelink = vti_changelink, ++ .dellink = ip_tunnel_dellink, + .get_size = vti_get_size, + .fill_info = vti_fill_info, + }; +--- a/net/ipv6/ip6_vti.c ++++ b/net/ipv6/ip6_vti.c +@@ -825,6 +825,15 @@ static int vti6_newlink(struct net *src_ + return vti6_tnl_create2(dev); + } + ++static void vti6_dellink(struct net_device *dev, struct list_head *head) ++{ ++ struct net *net = dev_net(dev); ++ struct vti6_net *ip6n = net_generic(net, vti6_net_id); ++ ++ if (dev != ip6n->fb_tnl_dev) ++ unregister_netdevice_queue(dev, head); ++} ++ + static int vti6_changelink(struct net_device *dev, struct nlattr *tb[], + struct nlattr *data[]) + { +@@ -900,6 +909,7 @@ static struct rtnl_link_ops vti6_link_op + .setup = vti6_dev_setup, + .validate = vti6_validate, + .newlink = vti6_newlink, ++ .dellink = vti6_dellink, + .changelink = vti6_changelink, + .get_size = vti6_get_size, + .fill_info = vti6_fill_info, +@@ -945,6 +955,7 @@ static int __net_init vti6_init_net(stru + if (!ip6n->fb_tnl_dev) + goto err_alloc_dev; + dev_net_set(ip6n->fb_tnl_dev, net); ++ ip6n->fb_tnl_dev->rtnl_link_ops = &vti6_link_ops; + + err = vti6_fb_tnl_dev_init(ip6n->fb_tnl_dev); + if (err < 0) diff --git a/queue-3.14/ipv6-gre-fix-wrong-skb-protocol-in-wccp.patch b/queue-3.14/ipv6-gre-fix-wrong-skb-protocol-in-wccp.patch new file mode 100644 index 00000000000..04eb038a8b0 --- /dev/null +++ b/queue-3.14/ipv6-gre-fix-wrong-skb-protocol-in-wccp.patch @@ -0,0 +1,39 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: Yuri Chislov +Date: Mon, 24 Nov 2014 11:25:15 +0100 +Subject: ipv6: gre: fix wrong skb->protocol in WCCP + +From: Yuri Chislov + +[ Upstream commit be6572fdb1bfbe23b2624d477de50af50b02f5d6 ] + +When using GRE redirection in WCCP, it sets the wrong skb->protocol, +that is, ETH_P_IP instead of ETH_P_IPV6 for the encapuslated traffic. + +Fixes: c12b395a4664 ("gre: Support GRE over IPv6") +Cc: Dmitry Kozlov +Signed-off-by: Yuri Chislov +Tested-by: Yuri Chislov +Signed-off-by: Daniel Borkmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/ip6_gre.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/ipv6/ip6_gre.c ++++ b/net/ipv6/ip6_gre.c +@@ -508,11 +508,11 @@ static int ip6gre_rcv(struct sk_buff *sk + + skb->protocol = gre_proto; + /* WCCP version 1 and 2 protocol decoding. +- * - Change protocol to IP ++ * - Change protocol to IPv6 + * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header + */ + if (flags == 0 && gre_proto == htons(ETH_P_WCCP)) { +- skb->protocol = htons(ETH_P_IP); ++ skb->protocol = htons(ETH_P_IPV6); + if ((*(h + offset) & 0xF0) != 0x40) + offset += 4; + } diff --git a/queue-3.14/net-mlx4_core-limit-count-field-to-24-bits-in-qp_alloc_res.patch b/queue-3.14/net-mlx4_core-limit-count-field-to-24-bits-in-qp_alloc_res.patch new file mode 100644 index 00000000000..0999d7be067 --- /dev/null +++ b/queue-3.14/net-mlx4_core-limit-count-field-to-24-bits-in-qp_alloc_res.patch @@ -0,0 +1,40 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: Jack Morgenstein +Date: Tue, 25 Nov 2014 11:54:31 +0200 +Subject: net/mlx4_core: Limit count field to 24 bits in qp_alloc_res + +From: Jack Morgenstein + +[ Upstream commit 2d5c57d7fbfaa642fb7f0673df24f32b83d9066c ] + +Some VF drivers use the upper byte of "param1" (the qp count field) +in mlx4_qp_reserve_range() to pass flags which are used to optimize +the range allocation. + +Under the current code, if any of these flags are set, the 32-bit +count field yields a count greater than 2^24, which is out of range, +and this VF fails. + +As these flags represent a "best-effort" allocation hint anyway, they may +safely be ignored. Therefore, the PF driver may simply mask out the bits. + +Fixes: c82e9aa0a8 "mlx4_core: resource tracking for HCA resources used by guests" +Signed-off-by: Jack Morgenstein +Signed-off-by: Or Gerlitz +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c ++++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +@@ -1456,7 +1456,7 @@ static int qp_alloc_res(struct mlx4_dev + + switch (op) { + case RES_OP_RESERVE: +- count = get_param_l(&in_param); ++ count = get_param_l(&in_param) & 0xffffff; + align = get_param_h(&in_param); + err = mlx4_grant_resource(dev, slave, RES_QP, count, 0); + if (err) diff --git a/queue-3.14/net-mvneta-fix-race-condition-in-mvneta_tx.patch b/queue-3.14/net-mvneta-fix-race-condition-in-mvneta_tx.patch new file mode 100644 index 00000000000..90b46920156 --- /dev/null +++ b/queue-3.14/net-mvneta-fix-race-condition-in-mvneta_tx.patch @@ -0,0 +1,40 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: Eric Dumazet +Date: Tue, 2 Dec 2014 04:30:59 -0800 +Subject: net: mvneta: fix race condition in mvneta_tx() + +From: Eric Dumazet + +[ Upstream commit 5f478b41033606d325e420df693162e2524c2b94 ] + +mvneta_tx() dereferences skb to get skb->len too late, +as hardware might have completed the transmit and TX completion +could have freed the skb from another cpu. + +Fixes: 71f6d1b31fb1 ("net: mvneta: replace Tx timer with a real interrupt") +Signed-off-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/marvell/mvneta.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -1612,6 +1612,7 @@ static int mvneta_tx(struct sk_buff *skb + u16 txq_id = skb_get_queue_mapping(skb); + struct mvneta_tx_queue *txq = &pp->txqs[txq_id]; + struct mvneta_tx_desc *tx_desc; ++ int len = skb->len; + struct netdev_queue *nq; + int frags = 0; + u32 tx_cmd; +@@ -1675,7 +1676,7 @@ out: + + u64_stats_update_begin(&stats->syncp); + stats->tx_packets++; +- stats->tx_bytes += skb->len; ++ stats->tx_bytes += len; + u64_stats_update_end(&stats->syncp); + } else { + dev->stats.tx_dropped++; diff --git a/queue-3.14/net-mvneta-fix-tx-interrupt-delay.patch b/queue-3.14/net-mvneta-fix-tx-interrupt-delay.patch new file mode 100644 index 00000000000..bc8d4afd0b5 --- /dev/null +++ b/queue-3.14/net-mvneta-fix-tx-interrupt-delay.patch @@ -0,0 +1,69 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: willy tarreau +Date: Tue, 2 Dec 2014 08:13:04 +0100 +Subject: net: mvneta: fix Tx interrupt delay + +From: willy tarreau + +[ Upstream commit aebea2ba0f7495e1a1c9ea5e753d146cb2f6b845 ] + +The mvneta driver sets the amount of Tx coalesce packets to 16 by +default. Normally that does not cause any trouble since the driver +uses a much larger Tx ring size (532 packets). But some sockets +might run with very small buffers, much smaller than the equivalent +of 16 packets. This is what ping is doing for example, by setting +SNDBUF to 324 bytes rounded up to 2kB by the kernel. + +The problem is that there is no documented method to force a specific +packet to emit an interrupt (eg: the last of the ring) nor is it +possible to make the NIC emit an interrupt after a given delay. + +In this case, it causes trouble, because when ping sends packets over +its raw socket, the few first packets leave the system, and the first +15 packets will be emitted without an IRQ being generated, so without +the skbs being freed. And since the socket's buffer is small, there's +no way to reach that amount of packets, and the ping ends up with +"send: no buffer available" after sending 6 packets. Running with 3 +instances of ping in parallel is enough to hide the problem, because +with 6 packets per instance, that's 18 packets total, which is enough +to grant a Tx interrupt before all are sent. + +The original driver in the LSP kernel worked around this design flaw +by using a software timer to clean up the Tx descriptors. This timer +was slow and caused terrible network performance on some Tx-bound +workloads (such as routing) but was enough to make tools like ping +work correctly. + +Instead here, we simply set the packet counts before interrupt to 1. +This ensures that each packet sent will produce an interrupt. NAPI +takes care of coalescing interrupts since the interrupt is disabled +once generated. + +No measurable performance impact nor CPU usage were observed on small +nor large packets, including when saturating the link on Tx, and this +fixes tools like ping which rely on too small a send buffer. If one +wants to increase this value for certain workloads where it is safe +to do so, "ethtool -C $dev tx-frames" will override this default +setting. + +This fix needs to be applied to stable kernels starting with 3.10. + +Tested-By: Maggie Mae Roxas +Signed-off-by: Willy Tarreau +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/marvell/mvneta.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -213,7 +213,7 @@ + /* Various constants */ + + /* Coalescing */ +-#define MVNETA_TXDONE_COAL_PKTS 16 ++#define MVNETA_TXDONE_COAL_PKTS 1 + #define MVNETA_RX_COAL_PKTS 32 + #define MVNETA_RX_COAL_USEC 100 + diff --git a/queue-3.14/net-sctp-use-max_header-for-headroom-reserve-in-output-path.patch b/queue-3.14/net-sctp-use-max_header-for-headroom-reserve-in-output-path.patch new file mode 100644 index 00000000000..4320ca5b100 --- /dev/null +++ b/queue-3.14/net-sctp-use-max_header-for-headroom-reserve-in-output-path.patch @@ -0,0 +1,52 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: Daniel Borkmann +Date: Wed, 3 Dec 2014 12:13:58 +0100 +Subject: net: sctp: use MAX_HEADER for headroom reserve in output path +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Daniel Borkmann + +[ Upstream commit 9772b54c55266ce80c639a80aa68eeb908f8ecf5 ] + +To accomodate for enough headroom for tunnels, use MAX_HEADER instead +of LL_MAX_HEADER. Robert reported that he has hit after roughly 40hrs +of trinity an skb_under_panic() via SCTP output path (see reference). +I couldn't reproduce it from here, but not using MAX_HEADER as elsewhere +in other protocols might be one possible cause for this. + +In any case, it looks like accounting on chunks themself seems to look +good as the skb already passed the SCTP output path and did not hit +any skb_over_panic(). Given tunneling was enabled in his .config, the +headroom would have been expanded by MAX_HEADER in this case. + +Reported-by: Robert Święcki +Reference: https://lkml.org/lkml/2014/12/1/507 +Fixes: 594ccc14dfe4d ("[SCTP] Replace incorrect use of dev_alloc_skb with alloc_skb in sctp_packet_transmit().") +Signed-off-by: Daniel Borkmann +Acked-by: Vlad Yasevich +Acked-by: Neil Horman +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/sctp/output.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/sctp/output.c ++++ b/net/sctp/output.c +@@ -401,12 +401,12 @@ int sctp_packet_transmit(struct sctp_pac + sk = chunk->skb->sk; + + /* Allocate the new skb. */ +- nskb = alloc_skb(packet->size + LL_MAX_HEADER, GFP_ATOMIC); ++ nskb = alloc_skb(packet->size + MAX_HEADER, GFP_ATOMIC); + if (!nskb) + goto nomem; + + /* Make sure the outbound skb has enough header room reserved. */ +- skb_reserve(nskb, packet->overhead + LL_MAX_HEADER); ++ skb_reserve(nskb, packet->overhead + MAX_HEADER); + + /* Set the owning socket so that we know where to get the + * destination IP address. diff --git a/queue-3.14/rtnetlink-release-net-refcnt-on-error-in-do_setlink.patch b/queue-3.14/rtnetlink-release-net-refcnt-on-error-in-do_setlink.patch new file mode 100644 index 00000000000..388acb31432 --- /dev/null +++ b/queue-3.14/rtnetlink-release-net-refcnt-on-error-in-do_setlink.patch @@ -0,0 +1,32 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: Nicolas Dichtel +Date: Thu, 27 Nov 2014 10:16:15 +0100 +Subject: rtnetlink: release net refcnt on error in do_setlink() + +From: Nicolas Dichtel + +[ Upstream commit e0ebde0e131b529fd721b24f62872def5ec3718c ] + +rtnl_link_get_net() holds a reference on the 'struct net', we need to release +it in case of error. + +CC: Eric W. Biederman +Fixes: b51642f6d77b ("net: Enable a userns root rtnl calls that are safe for unprivilged users") +Signed-off-by: Nicolas Dichtel +Reviewed-by: "Eric W. Biederman" +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/core/rtnetlink.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/core/rtnetlink.c ++++ b/net/core/rtnetlink.c +@@ -1453,6 +1453,7 @@ static int do_setlink(const struct sk_bu + goto errout; + } + if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) { ++ put_net(net); + err = -EPERM; + goto errout; + } diff --git a/queue-3.14/series b/queue-3.14/series index ada4606e1f9..49a4d94d380 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -15,3 +15,13 @@ usb-xhci-reset-a-halted-endpoint-immediately-when-we-encounter-a-stall.patch ahci-add-deviceids-for-sunrise-point-lp-sata-controller.patch ahci-disable-msi-on-samsung-0xa800-ssd.patch sata_fsl-fix-error-handling-of-irq_of_parse_and_map.patch +ip_tunnel-the-lack-of-vti_link_ops-dellink-cause-kernel-panic.patch +ipv6-gre-fix-wrong-skb-protocol-in-wccp.patch +fix-race-condition-between-vxlan_sock_add-and-vxlan_sock_release.patch +tg3-fix-ring-init-when-there-are-more-tx-than-rx-channels.patch +net-mlx4_core-limit-count-field-to-24-bits-in-qp_alloc_res.patch +rtnetlink-release-net-refcnt-on-error-in-do_setlink.patch +gre-set-inner-mac-header-in-gro-complete.patch +net-mvneta-fix-tx-interrupt-delay.patch +net-mvneta-fix-race-condition-in-mvneta_tx.patch +net-sctp-use-max_header-for-headroom-reserve-in-output-path.patch diff --git a/queue-3.14/tg3-fix-ring-init-when-there-are-more-tx-than-rx-channels.patch b/queue-3.14/tg3-fix-ring-init-when-there-are-more-tx-than-rx-channels.patch new file mode 100644 index 00000000000..22342099e3d --- /dev/null +++ b/queue-3.14/tg3-fix-ring-init-when-there-are-more-tx-than-rx-channels.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Dec 14 08:38:06 PST 2014 +From: Thadeu Lima de Souza Cascardo +Date: Tue, 25 Nov 2014 14:21:11 -0200 +Subject: tg3: fix ring init when there are more TX than RX channels + +From: Thadeu Lima de Souza Cascardo + +[ Upstream commit a620a6bc1c94c22d6c312892be1e0ae171523125 ] + +If TX channels are set to 4 and RX channels are set to less than 4, +using ethtool -L, the driver will try to initialize more RX channels +than it has allocated, causing an oops. + +This fix only initializes the RX ring if it has been allocated. + +Signed-off-by: Thadeu Lima de Souza Cascardo +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/tg3.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/tg3.c ++++ b/drivers/net/ethernet/broadcom/tg3.c +@@ -8548,7 +8548,8 @@ static int tg3_init_rings(struct tg3 *tp + if (tnapi->rx_rcb) + memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp)); + +- if (tg3_rx_prodring_alloc(tp, &tnapi->prodring)) { ++ if (tnapi->prodring.rx_std && ++ tg3_rx_prodring_alloc(tp, &tnapi->prodring)) { + tg3_free_rings(tp); + return -ENOMEM; + } diff --git a/queue-3.18/series b/queue-3.18/series new file mode 100644 index 00000000000..f0d2d9e0268 --- /dev/null +++ b/queue-3.18/series @@ -0,0 +1,11 @@ +fix-race-condition-between-vxlan_sock_add-and-vxlan_sock_release.patch +gre-set-inner-mac-header-in-gro-complete.patch +openvswitch-fix-flow-mask-validation.patch +mips-bpf-fix-broken-bpf_mod.patch +net-mvneta-fix-tx-interrupt-delay.patch +net-mvneta-fix-race-condition-in-mvneta_tx.patch +net-sctp-use-max_header-for-headroom-reserve-in-output-path.patch +tcp-fix-more-null-deref-after-prequeue-changes.patch +xen-netfront-use-correct-linear-area-after-linearizing-an-skb.patch +net-fix-suspicious-rcu_dereference_check-in-net-sched-sch_fq_codel.c.patch +netlink-use-jhash-as-hashfn-for-rhashtable.patch