提交 5c60533f 编写于 作者: A Andreas Steinmetz 提交者: Xie XiuQi

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: NAndreas Steinmetz <ast@domdv.de>
Acked-by: NWillem de Bruijn <willemb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ec0a3c7d
......@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册