• Daniel Borkmann's avatar
    vlan: pull on __vlan_insert_tag error path and fix csum correction · 9241e2df
    Daniel Borkmann authored
    When __vlan_insert_tag() fails from skb_vlan_push() path due to the
    skb_cow_head(), we need to undo the __skb_push() in the error path
    as well that was done earlier to move skb->data pointer to mac header.
    
    Moreover, I noticed that when in the non-error path the __skb_pull()
    is done and the original offset to mac header was non-zero, we fixup
    from a wrong skb->data offset in the checksum complete processing.
    
    So the skb_postpush_rcsum() really needs to be done before __skb_pull()
    where skb->data still points to the mac header start and thus operates
    under the same conditions as in __vlan_insert_tag().
    
    Fixes: 93515d53 ("net: move vlan pop/push functions into common code")
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9241e2df
skbuff.c 113 KB