• Jason Wang's avatar
    tuntap: properly align skb->head before building skb · 63b9ab65
    Jason Wang authored
    An unaligned alloc_frag->offset caused by previous allocation will
    result an unaligned skb->head. This will lead unaligned
    skb_shared_info and then unaligned dataref which requires to be
    aligned for accessing on some architecture. Fix this by aligning
    alloc_frag->offset before the frag refilling.
    
    Fixes: 0bbd7dad ("tun: make tun_build_skb() thread safe")
    Cc: Eric Dumazet <edumazet@google.com>
    Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
    Cc: Wei Wei <dotweiba@gmail.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Reported-by: default avatarWei Wei <dotweiba@gmail.com>
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    63b9ab65
tun.c 66.4 KB