Commit 6e5a03bc authored by Lv Yunlong's avatar Lv Yunlong Committed by David S. Miller

ethernet/netronome/nfp: Fix a use after free in nfp_bpf_ctrl_msg_rx

In nfp_bpf_ctrl_msg_rx, if
nfp_ccm_get_type(skb) == NFP_CCM_TYPE_BPF_BPF_EVENT is true, the skb
will be freed. But the skb is still used by nfp_ccm_rx(&bpf->ccm, skb).

My patch adds a return when the skb was freed.

Fixes: bcf0cafa ("nfp: split out common control message handling code")
Signed-off-by: default avatarLv Yunlong <lyl2019@mail.ustc.edu.cn>
Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ca441a71
...@@ -454,6 +454,7 @@ void nfp_bpf_ctrl_msg_rx(struct nfp_app *app, struct sk_buff *skb) ...@@ -454,6 +454,7 @@ void nfp_bpf_ctrl_msg_rx(struct nfp_app *app, struct sk_buff *skb)
dev_consume_skb_any(skb); dev_consume_skb_any(skb);
else else
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return;
} }
nfp_ccm_rx(&bpf->ccm, skb); nfp_ccm_rx(&bpf->ccm, skb);
......
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