* [PATCH] ipv6: release dst properly in ipip6_tunnel_xmit
@ 2013-12-20 9:20 roy.qing.li
2013-12-20 14:16 ` Eric Dumazet
0 siblings, 1 reply; 3+ messages in thread
From: roy.qing.li @ 2013-12-20 9:20 UTC (permalink / raw)
To: netdev
From: Li RongQing <roy.qing.li@gmail.com>
if a dst is not attached to anywhere, it should be released before
exit ipip6_tunnel_xmit, otherwise cause dst memory leakage.
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
net/ipv6/sit.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 366fbba..d68a224 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -966,8 +966,10 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6));
skb = iptunnel_handle_offloads(skb, false, SKB_GSO_SIT);
- if (IS_ERR(skb))
+ if (IS_ERR(skb)) {
+ ip_rt_put(rt);
goto out;
+ }
err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, IPPROTO_IPV6, tos,
ttl, df, !net_eq(tunnel->net, dev_net(dev)));
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ipv6: release dst properly in ipip6_tunnel_xmit
2013-12-20 9:20 [PATCH] ipv6: release dst properly in ipip6_tunnel_xmit roy.qing.li
@ 2013-12-20 14:16 ` Eric Dumazet
2013-12-27 18:16 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-12-20 14:16 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev
On Fri, 2013-12-20 at 17:20 +0800, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> if a dst is not attached to anywhere, it should be released before
> exit ipip6_tunnel_xmit, otherwise cause dst memory leakage.
>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
> net/ipv6/sit.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
> index 366fbba..d68a224 100644
> --- a/net/ipv6/sit.c
> +++ b/net/ipv6/sit.c
> @@ -966,8 +966,10 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
> tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6));
>
> skb = iptunnel_handle_offloads(skb, false, SKB_GSO_SIT);
> - if (IS_ERR(skb))
> + if (IS_ERR(skb)) {
> + ip_rt_put(rt);
> goto out;
> + }
>
> err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, IPPROTO_IPV6, tos,
> ttl, df, !net_eq(tunnel->net, dev_net(dev)));
Fixes: 61c1db7fae21 ("ipv6: sit: add GSO/TSO support")
Acked-by: Eric Dumazet <edumazet@google.com>
Thanks a lot !
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ipv6: release dst properly in ipip6_tunnel_xmit
2013-12-20 14:16 ` Eric Dumazet
@ 2013-12-27 18:16 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-12-27 18:16 UTC (permalink / raw)
To: eric.dumazet; +Cc: roy.qing.li, netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 20 Dec 2013 06:16:46 -0800
> On Fri, 2013-12-20 at 17:20 +0800, roy.qing.li@gmail.com wrote:
>> From: Li RongQing <roy.qing.li@gmail.com>
>>
>> if a dst is not attached to anywhere, it should be released before
>> exit ipip6_tunnel_xmit, otherwise cause dst memory leakage.
>>
>> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
...
> Fixes: 61c1db7fae21 ("ipv6: sit: add GSO/TSO support")
> Acked-by: Eric Dumazet <edumazet@google.com>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-27 18:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 9:20 [PATCH] ipv6: release dst properly in ipip6_tunnel_xmit roy.qing.li
2013-12-20 14:16 ` Eric Dumazet
2013-12-27 18:16 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).