summaryrefslogtreecommitdiffstats
path: root/net/ipv4/gre.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-06-24 15:26:00 +0200
committerDavid S. Miller <davem@davemloft.net>2013-06-26 01:07:44 +0200
commitbd8a7036c06cf15779b31a5397d4afcb12be81ea (patch)
treed78794e12fb4ac0005f019e6a51e797230d38970 /net/ipv4/gre.c
parentMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/lin... (diff)
downloadlinux-bd8a7036c06cf15779b31a5397d4afcb12be81ea.tar.xz
linux-bd8a7036c06cf15779b31a5397d4afcb12be81ea.zip
gre: fix a possible skb leak
commit 68c331631143 ("v4 GRE: Add TCP segmentation offload for GRE") added a possible skb leak, because it frees only the head of segment list, in case a skb_linearize() call fails. This patch adds a kfree_skb_list() helper to fix the bug. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Pravin B Shelar <pshelar@nicira.com> Cc: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv4/gre.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
index b2e805af9b87..7856d1651d05 100644
--- a/net/ipv4/gre.c
+++ b/net/ipv4/gre.c
@@ -178,7 +178,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
err = __skb_linearize(skb);
if (err) {
- kfree_skb(segs);
+ kfree_skb_list(segs);
segs = ERR_PTR(err);
goto out;
}