All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] macvlan: fix leak in macvlan_handle_frame
@ 2015-11-16 21:54 Sabrina Dubroca
  2015-11-16 22:07 ` David Miller
  2015-11-17 19:40 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Sabrina Dubroca @ 2015-11-16 21:54 UTC (permalink / raw)
  To: netdev; +Cc: jiri, kaber, Sabrina Dubroca

Reset pskb in macvlan_handle_frame in case skb_share_check returned a
clone.

Fixes: 8a4eb5734e8d ("net: introduce rx_handler results and logic around that")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 drivers/net/macvlan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 86f6c6292c27..06c8bfeaccd6 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -415,6 +415,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
 		skb = ip_check_defrag(dev_net(skb->dev), skb, IP_DEFRAG_MACVLAN);
 		if (!skb)
 			return RX_HANDLER_CONSUMED;
+		*pskb = skb;
 		eth = eth_hdr(skb);
 		macvlan_forward_source(skb, port, eth->h_source);
 		src = macvlan_hash_lookup(port, eth->h_source);
@@ -456,6 +457,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
 		goto out;
 	}
 
+	*pskb = skb;
 	skb->dev = dev;
 	skb->pkt_type = PACKET_HOST;
 
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-07 23:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 21:54 [PATCH net] macvlan: fix leak in macvlan_handle_frame Sabrina Dubroca
2015-11-16 22:07 ` David Miller
2015-11-17 19:40 ` David Miller
2015-12-06 23:35   ` Paul Gortmaker
2015-12-07 23:25     ` Paul Gortmaker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.