]> git.baikalelectronics.ru Git - kernel.git/commit
macvlan: Fix leaking skb in source mode with nodst option
authorMartin Willi <martin@strongswan.org>
Tue, 12 Apr 2022 09:34:57 +0000 (11:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Apr 2022 11:25:02 +0000 (12:25 +0100)
commit7309fb2179acd0a6d740c6031a583b1d65c6c3ea
treed1b64ce77ef60d6eb9b7538d5252884d0d953704
parent41f4c8e0ced6b8270ad66345b4ae987ea59162ab
macvlan: Fix leaking skb in source mode with nodst option

The MACVLAN receive handler clones skbs to all matching source MACVLAN
interfaces, before it passes the packet along to match on destination
based MACVLANs.

When using the MACVLAN nodst mode, passing the packet to destination based
MACVLANs is omitted and the handler returns with RX_HANDLER_CONSUMED.
However, the passed skb is not freed, leaking for any packet processed
with the nodst option.

Properly free the skb when consuming packets to fix that leak.

Fixes: 6c90ef918eb9 ("macvlan: Add nodst option to macvlan type source")
Signed-off-by: Martin Willi <martin@strongswan.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c