summaryrefslogtreecommitdiffstats
path: root/drivers/net/macvlan.c
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2015-11-16 22:54:20 +0100
committerDavid S. Miller <davem@davemloft.net>2015-11-17 20:39:29 +0100
commite639b8d8a7a728f0b05ef2df6cb6b45dc3d4e556 (patch)
tree34273bbcc5b651b9a9f2ce16548313e6e05ee09c /drivers/net/macvlan.c
parentipvlan: fix use after free of skb (diff)
downloadlinux-e639b8d8a7a728f0b05ef2df6cb6b45dc3d4e556.tar.xz
linux-e639b8d8a7a728f0b05ef2df6cb6b45dc3d4e556.zip
macvlan: fix leak in macvlan_handle_frame
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/macvlan.c2
1 files changed, 2 insertions, 0 deletions
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;