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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALs4sv0XxdR1+OfFQq5T94S4Q06jypGUDmkN=8rZ3Vir8HVYyA@mail.gmail.com>
Date: Mon, 21 Aug 2023 09:24:49 +0530
From: Pavan Chebbi <pavan.chebbi@...adcom.com>
To: Kees Cook <keescook@...omium.org>
Cc: Siva Reddy Kallam <siva.kallam@...adcom.com>, Fiona Ebner <f.ebner@...xmox.com>, 
	Prashant Sreedharan <prashant@...adcom.com>, Michael Chan <mchan@...adcom.com>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	Bagas Sanjaya <bagasdotme@...il.com>, netdev@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-hardening@...r.kernel.org
Subject: Re: [PATCH] tg3: Use slab_build_skb() when needed

On Fri, Aug 18, 2023 at 11:24 PM Kees Cook <keescook@...omium.org> wrote:
>
> The tg3 driver will use kmalloc() under some conditions. Check the
> frag_size and use slab_build_skb() when frag_size is 0. Silences
> the warning introduced by commit ce098da1497c ("skbuff: Introduce
> slab_build_skb()"):
>
>         Use slab_build_skb() instead
>         ...
>         tg3_poll_work+0x638/0xf90 [tg3]
>
> Reported-by: Fiona Ebner <f.ebner@...xmox.com>
> Closes: https://lore.kernel.org/all/1bd4cb9c-4eb8-3bdb-3e05-8689817242d1@proxmox.com
> Cc: Siva Reddy Kallam <siva.kallam@...adcom.com>
> Cc: Prashant Sreedharan <prashant@...adcom.com>
> Cc: Michael Chan <mchan@...adcom.com>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Cc: Jakub Kicinski <kuba@...nel.org>
> Cc: Paolo Abeni <pabeni@...hat.com>
> Cc: Bagas Sanjaya <bagasdotme@...il.com>
> Cc: netdev@...r.kernel.org
> Signed-off-by: Kees Cook <keescook@...omium.org>
> ---
>  drivers/net/ethernet/broadcom/tg3.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 5ef073a79ce9..cb2810f175cc 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -6881,7 +6881,10 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
>
>                         ri->data = NULL;
>
> -                       skb = build_skb(data, frag_size);
> +                       if (frag_size)
> +                               skb = build_skb(data, frag_size);
> +                       else
> +                               skb = slab_build_skb(data);
>                         if (!skb) {
>                                 tg3_frag_free(frag_size != 0, data);
>                                 goto drop_it_no_recycle;
> --
> 2.34.1
>
>

Thanks. LGTM.
Reviewed-by: Pavan Chebbi <pavan.chebbi@...adcom.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ