From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Cc: Haoxiang Li <haoxiang_li2024@163.com>,
kuba@kernel.org, louis.peens@corigine.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
qmo@kernel.org, daniel@iogearbox.net, bpf@vger.kernel.org,
oss-drivers@corigine.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] nfp: bpf: Add check for nfp_app_ctrl_msg_alloc()
Date: Tue, 18 Feb 2025 08:56:16 +0100 [thread overview]
Message-ID: <Z7Q9ILUfC90Vd490@mev-dev.igk.intel.com> (raw)
In-Reply-To: <CAH-L+nP5w7hRbONxPNG7NJtJzb-A0JOEMSq1hKNepM9GpFkt-g@mail.gmail.com>
On Tue, Feb 18, 2025 at 08:14:49AM +0530, Kalesh Anakkur Purayil wrote:
> On Tue, Feb 18, 2025 at 6:49 AM Haoxiang Li <haoxiang_li2024@163.com> wrote:
> >
> > Add check for the return value of nfp_app_ctrl_msg_alloc() in
> > nfp_bpf_cmsg_alloc() to prevent null pointer dereference.
> >
> > Fixes: ff3d43f7568c ("nfp: bpf: implement helpers for FW map ops")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> > ---
> > 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(+)
> >
> > diff --git a/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c b/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
> > index 2ec62c8d86e1..b02d5fbb8c8c 100644
> > --- a/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
> > +++ b/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
> > @@ -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 (!skp)
> > + return NULL;
> It looks like you did not compile this change.
>
> Also, next time you push a new version, please modify the subject as:
> "[PATCH net v3] xxxx"
Yeah, you need to send v3 (skp -> skb). Fix looks fine, other call to
nfp_app_ctrl_msg_alloc() is checking returned value as here.
Feel free to add my RB tag in v3.
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> > skb_put(skb, size);
> >
> > return skb;
> > --
> > 2.25.1
> >
> >
>
>
> --
> Regards,
> Kalesh AP
prev parent reply other threads:[~2025-02-18 7:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 1:17 [PATCH v2] nfp: bpf: Add check for nfp_app_ctrl_msg_alloc() Haoxiang Li
2025-02-18 2:44 ` Kalesh Anakkur Purayil
2025-02-18 7:56 ` Michal Swiatkowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z7Q9ILUfC90Vd490@mev-dev.igk.intel.com \
--to=michal.swiatkowski@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=haoxiang_li2024@163.com \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.peens@corigine.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.com \
--cc=qmo@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.