Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -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_shinfo(skb)->tx_flags |= SKBTX_DEV_ZEROCOPY;
	}
	}


	skb_reset_network_header(skb);
	rxhash = skb_get_rxhash(skb);
	rxhash = skb_get_rxhash(skb);
	netif_rx_ni(skb);
	netif_rx_ni(skb);