Commit 76fe4581 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tuntap: reset network header before calling skb_get_rxhash()

Commit 49974420 (tuntap: dont use skb after netif_rx_ni(skb))
introduced another bug.

skb_get_rxhash() needs to access the network header, and it was
set for us in netif_rx_ni().

We need to reset network header or else skb_flow_dissect() behavior
is out of control.
Reported-and-tested-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Tested-by: default avatarDaniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent df484191
......@@ -1199,6 +1199,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
skb_shinfo(skb)->tx_flags |= SKBTX_DEV_ZEROCOPY;
}
skb_reset_network_header(skb);
rxhash = skb_get_rxhash(skb);
netif_rx_ni(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment