Skip to content

Commit 6e5a03b

Browse files
Yunlongsdavem330
authored andcommitted
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: bcf0caf ("nfp: split out common control message handling code") Signed-off-by: Lv Yunlong <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ca441a7 commit 6e5a03b

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/netronome/nfp/bpf

1 file changed

+1
-0
lines changed

drivers/net/ethernet/netronome/nfp/bpf/cmsg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ void nfp_bpf_ctrl_msg_rx(struct nfp_app *app, struct sk_buff *skb)
454454
dev_consume_skb_any(skb);
455455
else
456456
dev_kfree_skb_any(skb);
457+
return;
457458
}
458459

459460
nfp_ccm_rx(&bpf->ccm, skb);

0 commit comments

Comments
 (0)