diff options
author | Eric Dumazet <[email protected]> | 2013-03-27 18:28:41 +0000 |
---|---|---|
committer | David S. Miller <[email protected]> | 2013-03-28 14:29:47 -0400 |
commit | 91c5746425aed8f7188a351f1224a26aa232e4b3 (patch) | |
tree | ca4e9973e799ff90633b213556db45b19271c57c | |
parent | 30de83a00d4e801741cd974fa6a75c77b3a579e6 (diff) |
aoe: reserve enough headroom on skbs
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 <[email protected]>
Tested-by: David Oostdyk <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Cc: Ed Cashin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 25ef5c014fca..92b6d7c51e39 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); |