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: <fjcv7v3fli7gcdm4yyppfnazzt4eojzlo7yprefnvzcrxqu6xo@7zmecfu6m25f>
Date: Mon, 8 Sep 2025 14:20:25 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Alok Tiwari <alok.a.tiwari@...cle.com>
Cc: quic_cang@...cinc.com, quic_asutoshd@...cinc.com, 
	peter.wang@...iatek.com, martin.petersen@...cle.com, alim.akhtar@...sung.com, 
	avri.altman@....com, bvanassche@....org, James.Bottomley@...senpartnership.com, 
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] scsi: ufs: mcq: Fix memory allocation checks for SQE
 and CQE

On Sun, Sep 07, 2025 at 12:40:16PM GMT, Alok Tiwari wrote:
> Previous checks incorrectly tested the DMA addresses (dma_handle)
> for NULL. Since dma_alloc_coherent() returns the CPU (virtual)
> address, the NULL check should be performed on the *_base_addr
> pointer to correctly detect allocation failures.
> 
> Update the checks to validate sqe_base_addr and cqe_base_addr
> instead of sqe_dma_addr and cqe_dma_addr.
> 
> Fixes: 4682abfae2eb ("scsi: ufs: core: mcq: Allocate memory for MCQ mode")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>

Reviewed-by: Manivannan Sadhasivam <mani@...nel.org>

- Mani

> Reviewed-by: Alim Akhtar <alim.akhtar@...sung.com>
> ---
> v1 -> v2
> rephrase commit message and added Reviewed-by Alim
> ---
>  drivers/ufs/core/ufs-mcq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
> index 1e50675772fe..cc88aaa106da 100644
> --- a/drivers/ufs/core/ufs-mcq.c
> +++ b/drivers/ufs/core/ufs-mcq.c
> @@ -243,7 +243,7 @@ int ufshcd_mcq_memory_alloc(struct ufs_hba *hba)
>  		hwq->sqe_base_addr = dmam_alloc_coherent(hba->dev, utrdl_size,
>  							 &hwq->sqe_dma_addr,
>  							 GFP_KERNEL);
> -		if (!hwq->sqe_dma_addr) {
> +		if (!hwq->sqe_base_addr) {
>  			dev_err(hba->dev, "SQE allocation failed\n");
>  			return -ENOMEM;
>  		}
> @@ -252,7 +252,7 @@ int ufshcd_mcq_memory_alloc(struct ufs_hba *hba)
>  		hwq->cqe_base_addr = dmam_alloc_coherent(hba->dev, cqe_size,
>  							 &hwq->cqe_dma_addr,
>  							 GFP_KERNEL);
> -		if (!hwq->cqe_dma_addr) {
> +		if (!hwq->cqe_base_addr) {
>  			dev_err(hba->dev, "CQE allocation failed\n");
>  			return -ENOMEM;
>  		}
> -- 
> 2.50.1
> 

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ