lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOgUPBu-c8HwYV0A-Wdga3z8P9+CY3=YUVg73qvq6OkeQ4=2Ag@mail.gmail.com>
Date: Tue, 18 Feb 2025 02:37:39 +0530
From: Guruswamy Basavaiah <guruswamy.basavaiah@...adcom.com>
To: Haoxiang Li <haoxiang_li2024@....com>
Cc: kuba@...nel.org, louis.peens@...igine.com, andrew+netdev@...n.ch, 
	davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com, qmo@...nel.org, 
	daniel@...earbox.net, bpf@...r.kernel.org, oss-drivers@...igine.com, 
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] nfp: bpf: Add check for nfp_app_ctrl_msg_alloc()

Hi Haoxiang,
Nitpick: The brackets `{}` in the `if (!skb)` check are not required
for a single-statement block. As per the Linux kernel coding style,
it's preferable to omit them unless necessary for readability.
Guru

On Mon, Feb 17, 2025 at 7:53 PM Haoxiang Li <haoxiang_li2024@....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@...r.kernel.org
> Signed-off-by: Haoxiang Li <haoxiang_li2024@....com>
> ---
>  drivers/net/ethernet/netronome/nfp/bpf/cmsg.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c b/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
> index 2ec62c8d86e1..09ea1bc72097 100644
> --- a/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
> +++ b/drivers/net/ethernet/netronome/nfp/bpf/cmsg.c
> @@ -20,6 +20,9 @@ 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;
> --
> 2.25.1
>
>

Download attachment "smime.p7s" of type "application/pkcs7-signature" (5454 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ