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-next>] [day] [month] [year] [list]
Message-Id: <1254242593-2279-1-git-send-email-swalter@lexmark.com>
Date:	Tue, 29 Sep 2009 12:43:13 -0400
From:	swalter@...mark.com
To:	davem@...emloft.net, netdev@...r.kernel.org
Cc:	swalter <swalter@...lter-d630 (none) >,
	Steven Walter <swalter@...mark.com>
Subject: [PATCH] dev_alloc_skb: avoid using GFP_ATOMIC

From: swalter <swalter@...lter-d630.(none)>


Signed-off-by: Steven Walter <swalter@...ev.prtdev.lexmark.com>
---
 net/core/skbuff.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 9e0597d..58ec625 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -306,7 +306,11 @@ struct sk_buff *dev_alloc_skb(unsigned int length)
 	 * There is more code here than it seems:
 	 * __dev_alloc_skb is an inline
 	 */
-	return __dev_alloc_skb(length, GFP_ATOMIC);
+	if (in_interrupt()  ||  in_atomic()  ||  irqs_disabled()) {
+		return __dev_alloc_skb(length, GFP_ATOMIC);
+	} else {
+		return __dev_alloc_skb(length, GFP_KERNEL);
+	}
 }
 EXPORT_SYMBOL(dev_alloc_skb);
 
-- 
1.6.2.3.g5bbe6

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