[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160401.150000.1165010490623034251.davem@davemloft.net>
Date: Fri, 01 Apr 2016 15:00:00 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: daniel@...earbox.net
Cc: jiri@...nulli.us, alexei.starovoitov@...il.com, jesse@...nel.org,
tom@...bertland.com, netdev@...r.kernel.org
Subject: Re: [PATCH net] vlan: pull on __vlan_insert_tag error path and fix
csum correction
From: Daniel Borkmann <daniel@...earbox.net>
Date: Fri, 1 Apr 2016 11:41:03 +0200
> 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.
Ugh, what a mess, are you sure any of this is right even after your
change? What happens (outside of the csum part) is this:
__skb_push(offset);
__vlan_insert_tag(); {
skb_push(VLAN_HLEN);
...
memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
}
__skb_pull(offset);
If I understand this correctly, the last pull will therefore put
skb->data pointing at vlan_ethhdr->h_vlan_TCI of the new VLAN header
pushed by __vlan_insert_tag().
That is assuming skb->data began right after the original ethernet
header.
To me, that postpull csum currently is absolutely in the correct spot,
because it's acting upon the pull done by __vlan_insert_tag(), not the
one done here by skb_vlan_push().
Right?
Can you tell me how you tested this? Just curious...
Powered by blists - more mailing lists