summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2018-11-17 21:57:02 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-23 08:17:03 +0100
commita21a82a9a3e5bdf12ee5cd4ff30d1fa6b30bc7a3 (patch)
tree1e824e254dc340e10b4c62951f6ee743131ace67 /net/core
parent852c280df5e3c4baee7b5787c918915bf32d8d72 (diff)
downloadlinux-rpi3-a21a82a9a3e5bdf12ee5cd4ff30d1fa6b30bc7a3.tar.gz
linux-rpi3-a21a82a9a3e5bdf12ee5cd4ff30d1fa6b30bc7a3.tar.bz2
linux-rpi3-a21a82a9a3e5bdf12ee5cd4ff30d1fa6b30bc7a3.zip
net-gro: reset skb->pkt_type in napi_reuse_skb()
[ Upstream commit 33d9a2c72f086cbf1087b2fd2d1a15aa9df14a7f ] eth_type_trans() assumes initial value for skb->pkt_type is PACKET_HOST. This is indeed the value right after a fresh skb allocation. However, it is possible that GRO merged a packet with a different value (like PACKET_OTHERHOST in case macvlan is used), so we need to make sure napi->skb will have pkt_type set back to PACKET_HOST. Otherwise, valid packets might be dropped by the stack because their pkt_type is not PACKET_HOST. napi_reuse_skb() was added in commit 96e93eab2033 ("gro: Add internal interfaces for VLAN"), but this bug always has been there. Fixes: 96e93eab2033 ("gro: Add internal interfaces for VLAN") Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index e16ba3625400..097c02101450 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5630,6 +5630,10 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
skb->vlan_tci = 0;
skb->dev = napi->dev;
skb->skb_iif = 0;
+
+ /* eth_type_trans() assumes pkt_type is PACKET_HOST */
+ skb->pkt_type = PACKET_HOST;
+
skb->encapsulation = 0;
skb_shinfo(skb)->gso_type = 0;
skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));