[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1364444921.15753.32.camel@edumazet-glaptop>
Date:	Wed, 27 Mar 2013 21:28:41 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Oostdyk <daveo@...mit.edu>, ecashin@...aid.com
Cc:	"Maciej W. Rozycki" <macro@...ux-mips.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH] aoe: reserve enough headroom on skbs
From: Eric Dumazet <edumazet@...gle.com>
Some network drivers use a non default hard_header_len
Transmitted skb should take into account dev->hard_header_len, or risk
crashes or expensive reallocations.
In the case of aoe, lets reserve MAX_HEADER bytes.
David reported a crash in defxx driver, solved by this patch.
Reported-by: David Oostdyk <daveo@...mit.edu>
Tested-by: David Oostdyk <daveo@...mit.edu>
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Cc: Ed Cashin <ecashin@...aid.com>
---
 drivers/block/aoe/aoecmd.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 25ef5c0..92b6d7c 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -51,8 +51,9 @@ new_skb(ulong len)
 {
 	struct sk_buff *skb;
 
-	skb = alloc_skb(len, GFP_ATOMIC);
+	skb = alloc_skb(len + MAX_HEADER, GFP_ATOMIC);
 	if (skb) {
+		skb_reserve(skb, MAX_HEADER);
 		skb_reset_mac_header(skb);
 		skb_reset_network_header(skb);
 		skb->protocol = __constant_htons(ETH_P_AOE);
--
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
 
