nfp: bpf: Add check for nfp_app_ctrl_msg_alloc()
Subsystems (6)
PATCH v3 1/1 nfp: bpf: Add check for nfp_app_ctrl_msg_alloc()
Add check for the return value of nfp_app_ctrl_msg_alloc() in nfp_bpf_cmsg_alloc() to prevent null pointer dereference.
---
Changes in v3:
- modify a spell error. Thanks, Kalesh!
Changes in v2:
- remove the bracket for one single-statement. Thanks, Guru!
--- drivers/net/ethernet/netronome/nfp/bpf/cmsg.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/netronome/nfp/bpf/cmsg.c +2 -0
@@ -20,6 +20,8 @@ nfp_bpf_cmsg_alloc(struct nfp_app_bpf *bpf, unsigned int size)struct sk_buff *skb; skb =nfp_app_ctrl_msg_alloc (bpf->app, size,GFP_KERNEL ); +if (!skb) +return NULL ;skb_put (skb, size);return skb;
Signature · 1 line
2.25.1
Quoted 30 lines · Haoxiang Li
Add check for the return value of
nfp_app_ctrl_msg_alloc()innfp_bpf_cmsg_alloc()to prevent null pointer dereference.Fixes ff3d43f7568c ("nfp: bpf: implement helpers for FW map ops")Signed-off-by Haoxiang Li <[email protected]>---
Changes in v3:
- modify a spell error. Thanks, Kalesh!
Changes in v2:
- remove the bracket for one single-statement. Thanks, Guru!--- drivers/net/ethernet/netronome/nfp/bpf/cmsg.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/ethernet/netronome/nfp/bpf/cmsg.c +2
-1@@ -20,6 +20,8 @@ nfp_bpf_cmsg_alloc(struct nfp_app_bpf *bpf, unsigned int size)struct sk_buff *skb; skb =nfp_app_ctrl_msg_alloc (bpf->app, size,GFP_KERNEL ); +if (!skb) +return NULL ;skb_put (skb, size);return skb; --
Quoted 3 lines
2.25.1
You should wait 24 hours before posting a new version of the patch.
https://docs.kernel.org/process/maintainer-netdev.html#resending-after-review
Signature · 2 lines
Regards, Kalesh AP
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Tue, 18 Feb 2025 11:04:09 +0800 you wrote:
Add check for the return value of
nfp_app_ctrl_msg_alloc()innfp_bpf_cmsg_alloc()to prevent null pointer dereference.Fixes ff3d43f7568c ("nfp: bpf: implement helpers for FW map ops")Signed-off-by Haoxiang Li <[email protected]>[...]
Here is the summary with links:
- [net,v3] nfp: bpf: Add check for nfp_app_ctrl_msg_alloc()
https://git.kernel.org/netdev/net/c/878e7b11736e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html