diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2015-11-16 22:54:20 +0100 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2016-10-26 23:15:29 +0800 |
commit | 97164eb83570f911e270436f5e4c286eb37ce831 (patch) | |
tree | 0bafd6ba77c99cf67f589ef7e24e5ef54f4516b6 | |
parent | e37ecd53989e3a4a7ed4ccb8cd38a11ddb8b4eff (diff) | |
download | lwn-97164eb83570f911e270436f5e4c286eb37ce831.tar.gz lwn-97164eb83570f911e270436f5e4c286eb37ce831.zip |
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>
-rw-r--r-- | drivers/net/macvlan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 6749acf6f3f4..e7352399b1fa 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -173,6 +173,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb) 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_handle_frame(struct sk_buff **pskb) if (!skb) goto out; + *pskb = skb; skb->dev = dev; skb->pkt_type = PACKET_HOST; |