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]
Date:   Thu, 22 Apr 2021 13:34:17 +0800
From:   Lu Baolu <baolu.lu@...ux.intel.com>
To:     Rolf Eike Beer <eb@...ix.com>, Joerg Roedel <joro@...tes.org>,
        Will Deacon <will@...nel.org>
Cc:     baolu.lu@...ux.intel.com, David Woodhouse <dwmw2@...radead.org>,
        iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iommu/vt-d: Fix sysfs leak in alloc_domain()

Hi Rolf,

On 4/22/21 1:39 PM, Rolf Eike Beer wrote:
> iommu_device_sysfs_add() is called before, so is has to be cleaned on subsequent
> errors.
> 
> Fixes: 39ab9555c2411 ("iommu: Add sysfs bindings for struct iommu_device")
> Cc: stable@...r.kernel.org # 4.11.x
> Signed-off-by: Rolf Eike Beer <eb@...ix.com>

Acked-by: Lu Baolu <baolu.lu@...ux.intel.com>

P.S. Next time when you submit a new version, please use a version tag.

Best regards,
baolu

> ---
>   drivers/iommu/intel/dmar.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
> index d5c51b5c20af..c2bfccb19e24 100644
> --- a/drivers/iommu/intel/dmar.c
> +++ b/drivers/iommu/intel/dmar.c
> @@ -1144,7 +1144,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
>   
>   		err = iommu_device_register(&iommu->iommu);
>   		if (err)
> -			goto err_unmap;
> +			goto err_sysfs;
>   	}
>   
>   	drhd->iommu = iommu;
> @@ -1152,6 +1152,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
>   
>   	return 0;
>   
> +err_sysfs:
> +	iommu_device_sysfs_remove(&iommu->iommu);
>   err_unmap:
>   	unmap_iommu(iommu);
>   error_free_seq_id:
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ