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] [day] [month] [year] [list]
Message-ID: <20250827181626.7d1dbc3f@kernel.org>
Date: Wed, 27 Aug 2025 18:16:26 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Abin Joseph <abin.joseph@....com>
Cc: <radhey.shyam.pandey@....com>, <andrew+netdev@...n.ch>,
 <davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
 <michal.simek@....com>, <git@....com>, <netdev@...r.kernel.org>,
 <linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
 <stable@...r.kernel.org>
Subject: Re: [PATCH net-next] net: xilinx: axienet: Add error handling for
 RX metadata pointer retrieval

On Tue, 26 Aug 2025 23:35:49 +0530 Abin Joseph wrote:
> Subject: [PATCH net-next] net: xilinx: axienet: Add error handling for RX metadata pointer retrieval

Sounds like a fix, please repost as [PATCH net], against the
netdev/net tree.

> Add proper error checking for dmaengine_desc_get_metadata_ptr() which
> can return an error pointer and lead to potential crashes or undefined
> behaviour if the pointer retrieval fails.
> 
> Properly handle the error by unmapping DMA buffer, freeing the skb and
> returning early to prevent further processing with invalid data.
> 
> Fixes: 6a91b846af85 ("net: axienet: Introduce dmaengine support")
> Signed-off-by: Abin Joseph <abin.joseph@....com>
> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 0d8a05fe541a..1729fd21d83b 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1166,8 +1166,17 @@ static void axienet_dma_rx_cb(void *data, const struct dmaengine_result *result)
>  	skb = skbuf_dma->skb;
>  	app_metadata = dmaengine_desc_get_metadata_ptr(skbuf_dma->desc, &meta_len,
>  						       &meta_max_len);
> -	dma_unmap_single(lp->dev, skbuf_dma->dma_address, lp->max_frm_size,
> -			 DMA_FROM_DEVICE);
> +
> +	dma_unmap_single(lp->dev, skbuf_dma->dma_address, lp->max_frm_size, DMA_FROM_DEVICE);

80 char width is still strongly preferred, at least in networking.
So please don't unwrap this line for no apparent reason :\

> +	if (IS_ERR(app_metadata)) {
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ