From: Eric Dumazet Date: Mon, 17 Dec 2012 04:39:20 +0000 (+0000) Subject: tuntap: reset network header before calling skb_get_rxhash() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76fe45812a3b134c39170ca32dfd4b7217d33145;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git tuntap: reset network header before calling skb_get_rxhash() Commit 499744209b2c (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: Kirill A. Shutemov Tested-by: Daniel Borkmann Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 255a9f574869..173acf5b369a 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -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);