Skip to content

Commit

Permalink
macvlan: fix leak in macvlan_handle_frame
Browse files Browse the repository at this point in the history
Reset pskb in macvlan_handle_frame in case skb_share_check returned a
clone.

Fixes: 8a4eb57 ("net: introduce rx_handler results and logic around that")
Signed-off-by: Sabrina Dubroca <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
qsn authored and davem330 committed Nov 17, 2015
1 parent a534dc5 commit e639b8d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit e639b8d

Please sign in to comment.