[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210329115002.8557-1-lyl2019@mail.ustc.edu.cn>
Date: Mon, 29 Mar 2021 04:50:02 -0700
From: Lv Yunlong <lyl2019@...l.ustc.edu.cn>
To: kuba@...nel.org, simon.horman@...ronome.com, davem@...emloft.net,
ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org,
oss-drivers@...ronome.com, linux-kernel@...r.kernel.org,
Lv Yunlong <lyl2019@...l.ustc.edu.cn>
Subject: [PATCH] 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: bcf0cafab44fd ("nfp: split out common control message handling code")
Signed-off-by: Lv Yunlong <lyl2019@...l.ustc.edu.cn>
---
drivers/net/ethernet/netronome/nfp/bpf/cmsg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c b/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
index 0e2db6ea79e9..2ec62c8d86e1 100644
--- a/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
+++ b/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
@@ -454,6 +454,7 @@ void nfp_bpf_ctrl_msg_rx(struct nfp_app *app, struct sk_buff *skb)
dev_consume_skb_any(skb);
else
dev_kfree_skb_any(skb);
+ return;
}
nfp_ccm_rx(&bpf->ccm, skb);
--
2.25.1
Powered by blists - more mailing lists