提交 91c57464 编写于 作者: E Eric Dumazet 提交者: David S. Miller

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: NDavid Oostdyk <daveo@ll.mit.edu>
Tested-by: NDavid Oostdyk <daveo@ll.mit.edu>
Signed-off-by: NEric Dumazet <edumazet@google.com>
Cc: Ed Cashin <ecashin@coraid.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 30de83a0
...@@ -51,8 +51,9 @@ new_skb(ulong len) ...@@ -51,8 +51,9 @@ new_skb(ulong len)
{ {
struct sk_buff *skb; struct sk_buff *skb;
skb = alloc_skb(len, GFP_ATOMIC); skb = alloc_skb(len + MAX_HEADER, GFP_ATOMIC);
if (skb) { if (skb) {
skb_reserve(skb, MAX_HEADER);
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb_reset_network_header(skb); skb_reset_network_header(skb);
skb->protocol = __constant_htons(ETH_P_AOE); skb->protocol = __constant_htons(ETH_P_AOE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册