Skip to content

Commit a21a82a

Browse files
edumazetgregkh
authored andcommitted
net-gro: reset skb->pkt_type in napi_reuse_skb()
[ Upstream commit 33d9a2c ] 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 96e93ea ("gro: Add internal interfaces for VLAN"), but this bug always has been there. Fixes: 96e93ea ("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>
1 parent 852c280 commit a21a82a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎net/core/dev.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5630,6 +5630,10 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
56305630
skb->vlan_tci = 0;
56315631
skb->dev = napi->dev;
56325632
skb->skb_iif = 0;
5633+
5634+
/* eth_type_trans() assumes pkt_type is PACKET_HOST */
5635+
skb->pkt_type = PACKET_HOST;
5636+
56335637
skb->encapsulation = 0;
56345638
skb_shinfo(skb)->gso_type = 0;
56355639
skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));

0 commit comments

Comments
 (0)