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: <Z/NjXSRVFp9c/XmQ@mev-dev.igk.intel.com>
Date: Mon, 7 Apr 2025 07:32:13 +0200
From: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
To: Chenyuan Yang <chenyuan0y@...il.com>
Cc: jiawenwu@...stnetic.com, mengyuanlou@...-swift.com,
	andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
	jdamato@...tly.com, duanqiangwen@...-swift.com, dlemoal@...nel.org,
	netdev@...r.kernel.org
Subject: Re: [PATCH] net: libwx: handle page_pool_dev_alloc_pages error

On Sun, Apr 06, 2025 at 02:23:51PM -0500, Chenyuan Yang wrote:
> page_pool_dev_alloc_pages could return NULL. There was a WARN_ON(!page)
> but it would still proceed to use the NULL pointer and then crash.
> 
> This is similar to commit 001ba0902046
> ("net: fec: handle page_pool_dev_alloc_pages error").
> 
> Signed-off-by: Chenyuan Yang <chenyuan0y@...il.com>
> ---
>  drivers/net/ethernet/wangxun/libwx/wx_lib.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> index 00b0b318df27..d567443b1b20 100644
> --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> @@ -310,7 +310,8 @@ static bool wx_alloc_mapped_page(struct wx_ring *rx_ring,
>  		return true;
>  
>  	page = page_pool_dev_alloc_pages(rx_ring->page_pool);
> -	WARN_ON(!page);
> +	if (unlikely(!page))
> +		return false;
>  	dma = page_pool_get_dma_addr(page);
>  
>  	bi->page_dma = dma;

Thanks for fixing, it is fine, however you need to add fixes tag.
Probably:
Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI")

> -- 
> 2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ