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]
Message-ID: <87vbuzjeut.fsf_-_@x220.int.ebiederm.org>
Date:	Thu, 27 Mar 2014 18:23:22 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	David Miller <davem@...emloft.net>
Cc:	'Bjørn Mork' <bjorn@...k.no>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Ben Hutchings <ben@...adent.org.uk>,
	"stephen\@networkplumber.org" <stephen@...workplumber.org>,
	"netdev\@vger.kernel.org" <netdev@...r.kernel.org>,
	"xiyou.wangcong\@gmail.com" <xiyou.wangcong@...il.com>,
	"mpm\@selenic.com" <mpm@...enic.com>,
	"satyam.sharma\@gmail.com" <satyam.sharma@...il.com>,
	David Laight <David.Laight@...LAB.COM>
Subject: [PATCH 3/3] net: Warn when a skb is freed inappropriately in hard irq context.


Use skb_irq_freeable to warn on all cases where it is not safe to free a
skb in hard irq context.

Signed-off-by: "Eric W. Biederman" <ebiederm@...ssion.com>
---
 net/core/skbuff.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3f14c638c2b1..aaee52840a7d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -554,14 +554,14 @@ static void kfree_skbmem(struct sk_buff *skb)
 
 static void skb_release_head_state(struct sk_buff *skb)
 {
+	WARN_ON(in_irq() && !skb_irq_freeable(skb));
+
 	skb_dst_drop(skb);
 #ifdef CONFIG_XFRM
 	secpath_put(skb->sp);
 #endif
-	if (skb->destructor) {
-		WARN_ON(in_irq());
+	if (skb->destructor)
 		skb->destructor(skb);
-	}
 #if IS_ENABLED(CONFIG_NF_CONNTRACK)
 	nf_conntrack_put(skb->nfct);
 #endif
-- 
1.7.10.4

--
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