Commit a5e9991f authored by Andreas Steinmetz's avatar Andreas Steinmetz Committed by Greg Kroah-Hartman

macsec: fix use-after-free of skb during RX

[ Upstream commit 095c02da ]

Fix use-after-free of skb when rx_handler returns RX_HANDLER_PASS.
Signed-off-by: default avatarAndreas Steinmetz <ast@domdv.de>
Acked-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7edddedc
......@@ -1103,10 +1103,9 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
}
skb = skb_unshare(skb, GFP_ATOMIC);
if (!skb) {
*pskb = NULL;
*pskb = skb;
if (!skb)
return RX_HANDLER_CONSUMED;
}
pulled_sci = pskb_may_pull(skb, macsec_extra_len(true));
if (!pulled_sci) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment