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: <54bf1026-7d71-466d-b6c0-8714c7230f9f@kernel.org>
Date: Thu, 5 Feb 2026 07:54:41 +0100
From: "Christophe Leroy (CS GROUP)" <chleroy@...nel.org>
To: Thomas Fourier <fourier.thomas@...il.com>
Cc: stable@...r.kernel.org, Zhao Qiang <qiang.zhao@....com>,
 Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 netdev@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: wan/fsl_ucc_hdlc: Fix dma_free_coherent() in
 uhdlc_memclean()



Le 04/02/2026 à 17:25, Thomas Fourier a écrit :
> [Vous ne recevez pas souvent de courriers de fourier.thomas@...il.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> The priv->rx_buffer and priv->dma_rx_addr are alloc'd together as

You mean priv->rx_buffer and priv->tx_buffer I guess.

> contiguous buffers in uhdlc_init() but freed as two buffers in
> uhdlc_memclean().
> 
> Change the cleanup to only call dma_free_coherent() once on the whole
> buffer.
> 
> Fixes: c19b6d246a35 ("drivers/net: support hdlc function for QE-UCC")
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Thomas Fourier <fourier.thomas@...il.com>
> ---
>   drivers/net/wan/fsl_ucc_hdlc.c | 10 +---------
>   1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index f999798a5612..59cd861d13d6 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -790,19 +790,11 @@ static void uhdlc_memclean(struct ucc_hdlc_private *priv)
> 
>          if (priv->rx_buffer) {
>                  dma_free_coherent(priv->dev,
> -                                 RX_BD_RING_LEN * MAX_RX_BUF_LENGTH,
> +                                 (RX_BD_RING_LEN + TX_BD_RING_LEN) * MAX_RX_BUF_LENGTH,
>                                    priv->rx_buffer, priv->dma_rx_addr);
>                  priv->rx_buffer = NULL;
>                  priv->dma_rx_addr = 0;

You also have to do:
		priv->tx_buffer = NULL;
		priv->dma_tx_addr = 0;


Which that and commit message fixed you can add Reviewed-by: Christophe 
Leroy (CS GROUP) <chleroy@...nel.org>




>          }
> -
> -       if (priv->tx_buffer) {
> -               dma_free_coherent(priv->dev,
> -                                 TX_BD_RING_LEN * MAX_RX_BUF_LENGTH,
> -                                 priv->tx_buffer, priv->dma_tx_addr);
> -               priv->tx_buffer = NULL;
> -               priv->dma_tx_addr = 0;
> -       }
>   }
> 
>   static int uhdlc_close(struct net_device *dev)
> --
> 2.43.0
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ