ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()
Subsystems (3)
PATCH 1/1 ipv6/ip6_gre: fix error case handling in ip6gre_tunnel_xmit()
ip6gre_tunnel_xmit() is leaking the skb when we hit this error branch, and the -1 return value from this function is bogus. Use the error handling we already have in place in ip6gre_tunnel_xmit() for this error case to fix this.
--- net/ipv6/ip6_gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_gre.c +1 -1
@@ -960,7 +960,7 @@ static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb,int ret;if (!ip6_tnl_xmit_ctl (t)) -return -1 ; + goto tx_err;switch (skb->protocol) {case htons (ETH_P_IP ):
Signature · 1 line
1.8.1
Quoted 15 lines · Tommi Rantala
ip6gre_tunnel_xmit()is leaking the skb when we hit this error branch, and the -1 return value from this function is bogus. Use the error handling we already have in place inip6gre_tunnel_xmit()for this error case to fix this.Signed-off-by Tommi Rantala <[email protected]>--- net/ipv6/ip6_gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv6/ip6_gre.c +0
-0
net/ipv6/ip6_gre.c static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb, · line 966
Quoted 8 lines
net/ipv6/ip6_gre.c +1
-1@@ -960,7 +960,7 @@ static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb,int ret;if (!ip6_tnl_xmit_ctl (t)) -return -1 ; + goto tx_err;switch (skb->protocol) {case htons (ETH_P_IP ):
Thanks Tommi
From: Eric Dumazet <[email protected]>
Date: Wed, 06 Feb 2013 05:29:55 -0800
Quoted 18 lines · Tommi Rantala
Quoted 17 lines
ip6gre_tunnel_xmit()is leaking the skb when we hit this error branch, and the -1 return value from this function is bogus. Use the error handling we already have in place inip6gre_tunnel_xmit()for this error case to fix this.Signed-off-by Tommi Rantala <[email protected]>--- net/ipv6/ip6_gre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ipv6/ip6_gre.c +0
-0@@ -960,7 +960,7 @@ static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb,int ret;
Quoted 8 lines
net/ipv6/ip6_gre.c static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb, · line 966
Quoted 6 lines
net/ipv6/ip6_gre.c +1
-1if (!ip6_tnl_xmit_ctl (t)) -return -1 ; + goto tx_err;switch (skb->protocol) {case htons (ETH_P_IP ):Acked-by Eric Dumazet <[email protected]>
Applied, thanks everyone.