lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 08 May 2008 23:41:22 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	paul@...rks.net
Cc:	netdev@...r.kernel.org
Subject: Re: When should kfree_skb be used?

From: "Paul Marks" <paul@...rks.net>
Date: Thu, 8 May 2008 23:34:59 -0700

> I've been looking at more uses of pskb_may_pull(), and almost all of
> them seem to kfree_skb() after a failure.  Could this occurence in
> sit.c be a bug?  It looks like this line was added by davem for linux
> 2.4.4 in 2001, and hasn't changed since.

Yep, looks like a leak.  The following should fix it, thanks
for the report:

>From 36ca34cc3b8335eb1fe8bd9a1d0a2592980c3f02 Mon Sep 17 00:00:00 2001
From: David S. Miller <davem@...emloft.net>
Date: Thu, 8 May 2008 23:40:26 -0700
Subject: [PATCH] sit: Add missing kfree_skb() on pskb_may_pull() failure.

Noticed by Paul Marks <paul@...rks.net>.

Signed-off-by: David S. Miller <davem@...emloft.net>
---
 net/ipv6/sit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 4b2f103..5a6fab9 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -596,9 +596,9 @@ static int ipip6_rcv(struct sk_buff *skb)
 	}
 
 	icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
-	kfree_skb(skb);
 	read_unlock(&ipip6_lock);
 out:
+	kfree_skb(skb);
 	return 0;
 }
 
-- 
1.5.5.1.57.g5909c

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ