[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200609290245.33618.jesper.juhl@gmail.com>
Date: Fri, 29 Sep 2006 02:45:33 +0200
From: Jesper Juhl <jesper.juhl@...il.com>
To: linux-kernel@...r.kernel.org
Cc: netdev@...r.kernel.org, dccp@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
"David S. Miller" <davem@...emloft.net>,
Pekka Savola <pekkas@...core.fi>,
James Morris <jmorris@...ei.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...eworks.de>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Jesper Juhl <jesper.juhl@...il.com>
Subject: [PATCH] IPv6/DCCP: Fix memory leak in dccp_v6_do_rcv()
Coverity found what looks like a real leak in net/dccp/ipv6.c::dccp_v6_do_rcv()
We may leave via the return inside "if (sk->sk_state == DCCP_OPEN) {"
but at that point we may have allocated opt_skb, but we never free it
in that path before the return.
Signed-off-by: Jesper Juhl <jesper.juhl@...il.com>
---
net/dccp/ipv6.c | 2 ++
1 file changed, 2 insertions(+)
--- linux-2.6.18-git10-orig/net/dccp/ipv6.c 2006-09-28 22:40:07.000000000 +0200
+++ linux-2.6.18-git10/net/dccp/ipv6.c 2006-09-29 02:35:15.000000000 +0200
@@ -997,6 +997,8 @@ static int dccp_v6_do_rcv(struct sock *s
if (sk->sk_state == DCCP_OPEN) { /* Fast path */
if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len))
goto reset;
+ if (opt_skb)
+ __kfree_skb(opt_skb);
return 0;
}
PS. Please keep me on Cc:
--
Jesper Juhl <jesper.juhl@...il.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists