]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
ethernet/netronome/nfp: Fix a use after free in nfp_bpf_ctrl_msg_rx
authorLv Yunlong <lyl2019@mail.ustc.edu.cn>
Mon, 29 Mar 2021 11:50:02 +0000 (04:50 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:53:24 +0000 (09:53 +0200)
commit2ff94405ba2ae987040088c78f14b48c4e260d94
treec31d498c79d12e802a00221e8faf0f645b14a12a
parent9a3368b14a3b2dcefd44422a714290b922710f93
ethernet/netronome/nfp: Fix a use after free in nfp_bpf_ctrl_msg_rx

BugLink: https://bugs.launchpad.net/bugs/1926368
commit 6e5a03bcba44e080a6bf300194a68ce9bb1e5184 upstream.

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@mail.ustc.edu.cn>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/netronome/nfp/bpf/cmsg.c