lkml.org 
[lkml]   [2013]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[ 160/171 ] aoe: reserve enough headroom on skbs
    3.6.11.2 stable review patch.
    If anyone has any objections, please let me know.

    ------------------

    From: Eric Dumazet <edumazet@google.com>

    [ Upstream commit 91c5746425aed8f7188a351f1224a26aa232e4b3 ]

    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@ll.mit.edu>
    Tested-by: David Oostdyk <daveo@ll.mit.edu>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Ed Cashin <ecashin@coraid.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    ---
    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 887f68f..db30542 100644
    --- a/drivers/block/aoe/aoecmd.c
    +++ b/drivers/block/aoe/aoecmd.c
    @@ -30,8 +30,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);
    --
    1.7.10.4



    \
     
     \ /
      Last update: 2013-04-12 00:01    [W:6.085 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site