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:	Tue, 13 Nov 2012 12:12:41 -0600
From:	Matthew Thode <prometheanfire@...too.org>
To:	Alex Williamson <alex.williamson@...hat.com>
CC:	iommu@...ts.linux-foundation.org, joro@...tes.org,
	cardoe@...too.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, mthode@...ode.org,
	ddutile@...hat.com, bhelgaas@...gle.com, dwmw2@...radead.org
Subject: Re: [PATCH] intel-iommu: Fix lookup in add device

On 11/13/2012 11:22 AM, Alex Williamson wrote:
> We can't assume this device exists, fall back to the bridge itself.
> 
> Signed-off-by: Alex Williamson <alex.williamson@...hat.com>
> Tested-by: Matthew Thode <prometheanfire@...too.org>
> Cc: stable@...r.kernel.org
> ---
>  drivers/iommu/intel-iommu.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index d4a4cd4..0badfa4 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -4108,7 +4108,7 @@ static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to)
>  static int intel_iommu_add_device(struct device *dev)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev);
> -	struct pci_dev *bridge, *dma_pdev;
> +	struct pci_dev *bridge, *dma_pdev = NULL;
>  	struct iommu_group *group;
>  	int ret;
>  
> @@ -4122,7 +4122,7 @@ static int intel_iommu_add_device(struct device *dev)
>  			dma_pdev = pci_get_domain_bus_and_slot(
>  						pci_domain_nr(pdev->bus),
>  						bridge->subordinate->number, 0);
> -		else
> +		if (!dma_pdev)
>  			dma_pdev = pci_dev_get(bridge);
>  	} else
>  		dma_pdev = pci_dev_get(pdev);
> 

I've tested this and it works just fine.

-- 
-- Matthew Thode (prometheanfire)


Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ