netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	<netdev@vger.kernel.org>
Subject: [PATCH 4/5] vti6: Fix dst_entry leek on pmtu discovery
Date: Thu, 10 Mar 2016 11:24:28 +0100	[thread overview]
Message-ID: <1457605469-17332-5-git-send-email-steffen.klassert@secunet.com> (raw)
In-Reply-To: <1457605469-17332-1-git-send-email-steffen.klassert@secunet.com>

We may exit without releasing the dst_entry on pmtu discovery,
so don't return directly but goto the te error handling. This
also makes sure that the statistic counter gets updated.

Fixes: ccd740cbc6e0 ("vti6: Add pmtu handling to vti6_xmit.")
Reported-by: Mark McKinstry <Mark.McKinstry@alliedtelesis.co.nz>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/ip6_vti.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index 0a8610b..555ac2b 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -479,7 +479,8 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)
 			icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
 				  htonl(mtu));
 
-		return -EMSGSIZE;
+		err = -EMSGSIZE;
+		goto tx_err_dst_release;
 	}
 
 	err = dst_output(t->net, skb->sk, skb);
-- 
1.9.1

  parent reply	other threads:[~2016-03-10 10:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 10:24 pull request (net): ipsec 2016-03-10 Steffen Klassert
2016-03-10 10:24 ` [PATCH 1/5] vti: Add pmtu handling to vti_xmit Steffen Klassert
2016-03-10 10:24 ` [PATCH 2/5] flowcache: Avoid OOM condition under preasure Steffen Klassert
2016-03-10 10:24 ` [PATCH 3/5] xfrm: Reset encapsulation field of the skb before transformation Steffen Klassert
2016-03-10 10:24 ` Steffen Klassert [this message]
2016-03-10 13:52   ` [PATCH 4/5] vti6: Fix dst_entry leek on pmtu discovery Sergei Shtylyov
2016-03-10 10:24 ` [PATCH 5/5] vti: Fix recource leeks " Steffen Klassert
2016-03-10 13:53   ` Sergei Shtylyov
2016-03-14 19:21 ` pull request (net): ipsec 2016-03-10 David Miller
2016-03-15  6:59   ` Steffen Klassert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457605469-17332-5-git-send-email-steffen.klassert@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).