Message ID | 20200526122751.409917-1-alexander.sverdlin@nokia.com |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | macvlan: Skip loopback packets in RX handler | expand |
From: Alexander A Sverdlin <alexander.sverdlin@nokia.com> Date: Tue, 26 May 2020 14:27:51 +0200 > From: Alexander Sverdlin <alexander.sverdlin@nokia.com> > > Ignore loopback-originatig packets soon enough and don't try to process L2 > header where it doesn't exist. The very similar br_handle_frame() in bridge > code performs exactly the same check. > > This is an example of such ICMPv6 packet: ... > Call Trace, how it happens exactly: > ... > macvlan_handle_frame+0x321/0x425 [macvlan] > ? macvlan_forward_source+0x110/0x110 [macvlan] > __netif_receive_skb_core+0x545/0xda0 ... > Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com> Applied to net-next, thanks.
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index e7289d6..7cea2fa 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -447,6 +447,10 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb) int ret; rx_handler_result_t handle_res; + /* Packets from dev_loopback_xmit() do not have L2 header, bail out */ + if (unlikely(skb->pkt_type == PACKET_LOOPBACK)) + return RX_HANDLER_PASS; + port = macvlan_port_get_rcu(skb->dev); if (is_multicast_ether_addr(eth->h_dest)) { unsigned int hash;