| From e639b8d8a7a728f0b05ef2df6cb6b45dc3d4e556 Mon Sep 17 00:00:00 2001 |
| From: Sabrina Dubroca <sd@queasysnail.net> |
| Date: Mon, 16 Nov 2015 22:54:20 +0100 |
| Subject: macvlan: fix leak in macvlan_handle_frame |
| |
| commit e639b8d8a7a728f0b05ef2df6cb6b45dc3d4e556 upstream. |
| |
| 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> |
| Signed-off-by: Zefan Li <lizefan@huawei.com> |
| --- |
| drivers/net/macvlan.c | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| --- a/drivers/net/macvlan.c |
| +++ b/drivers/net/macvlan.c |
| @@ -173,6 +173,7 @@ static rx_handler_result_t macvlan_handl |
| skb = ip_check_defrag(skb, IP_DEFRAG_MACVLAN); |
| if (!skb) |
| return RX_HANDLER_CONSUMED; |
| + *pskb = skb; |
| eth = eth_hdr(skb); |
| src = macvlan_hash_lookup(port, eth->h_source); |
| if (!src) |
| @@ -222,6 +223,7 @@ static rx_handler_result_t macvlan_handl |
| if (!skb) |
| goto out; |
| |
| + *pskb = skb; |
| skb->dev = dev; |
| skb->pkt_type = PACKET_HOST; |
| |