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]
Date:   Mon, 6 Nov 2017 13:05:31 -0700
From:   Alex Williamson <alex.williamson@...hat.com>
To:     Wei Yongjun <weiyongjun1@...wei.com>
Cc:     Joerg Roedel <joro@...tes.org>, iommu@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, Robin Murphy <robin.murphy@....com>
Subject: Re: [PATCH -next] iommu/ipmmu-vmsa: Fix return value check in
 ipmmu_find_group_dma()

On Tue, 17 Oct 2017 12:11:22 +0000
Wei Yongjun <weiyongjun1@...wei.com> wrote:

> In case of error, the function iommu_group_get() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
> 
> Fixes: 3ae47292024f ("iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops")
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
> ---
>  drivers/iommu/ipmmu-vmsa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> index af81400..00e88a8 100644
> --- a/drivers/iommu/ipmmu-vmsa.c
> +++ b/drivers/iommu/ipmmu-vmsa.c
> @@ -871,7 +871,7 @@ static struct iommu_group *ipmmu_find_group_dma(struct device *dev)
>  	sibling = ipmmu_find_sibling_device(dev);
>  	if (sibling)
>  		group = iommu_group_get(sibling);
> -	if (!sibling || IS_ERR(group))
> +	if (!sibling || !group)
>  		group = generic_device_group(dev);
>  
>  	return group;


Applied to iommu/ipmmu-vmsa for v4.15.

Note that Robin's patch series[1] reworks this code, removing the call
to iommu_group_get(), but it seems correct in case anyone wants to
cherry pick it for backports.  Thanks,

Alex

[1]https://www.spinics.net/lists/linux-renesas-soc/msg19228.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ