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: <CAAfSe-s-x0igV_Zoz=sCXjBByjR49pxGcAQnkZEFobjOCGuVDA@mail.gmail.com>
Date: Wed, 17 Jul 2024 14:19:51 +0800
From: Chunyan Zhang <zhang.lyra@...il.com>
To: Artem Chernyshev <artem.chernyshev@...-soft.ru>
Cc: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>, 
	Robin Murphy <robin.murphy@....com>, iommu@...ts.linux.dev, linux-kernel@...r.kernel.org, 
	lvc-project@...uxtesting.org
Subject: Re: [PATCH] iommu: sprd: Avoid NULL deref in sprd_iommu_hw_en

On Tue, 16 Jul 2024 at 20:55, Artem Chernyshev
<artem.chernyshev@...-soft.ru> wrote:
>
> In sprd_iommu_cleanup() before calling function sprd_iommu_hw_en()
> dom->sdev is equal to NULL, which leads to null dereference.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 9afea57384d4 ("iommu/sprd: Release dma buffer to avoid memory leak")
> Signed-off-by: Artem Chernyshev <artem.chernyshev@...-soft.ru>

Thanks for fixing this.

Reviewed-by: Chunyan Zhang <zhang.lyra@...il.com>

> ---
>  drivers/iommu/sprd-iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c
> index ba53571a8239..a2f4ffe6d949 100644
> --- a/drivers/iommu/sprd-iommu.c
> +++ b/drivers/iommu/sprd-iommu.c
> @@ -232,8 +232,8 @@ static void sprd_iommu_cleanup(struct sprd_iommu_domain *dom)
>
>         pgt_size = sprd_iommu_pgt_size(&dom->domain);
>         dma_free_coherent(dom->sdev->dev, pgt_size, dom->pgt_va, dom->pgt_pa);
> -       dom->sdev = NULL;
>         sprd_iommu_hw_en(dom->sdev, false);
> +       dom->sdev = NULL;
>  }
>
>  static void sprd_iommu_domain_free(struct iommu_domain *domain)
> --
> 2.44.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ