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]
Message-ID: <20200414152752.GC14731@8bytes.org>
Date:   Tue, 14 Apr 2020 17:27:52 +0200
From:   "joro@...tes.org" <joro@...tes.org>
To:     "Derrick, Jonathan" <jonathan.derrick@...el.com>
Cc:     "heiko@...ech.de" <heiko@...ech.de>,
        "kgene@...nel.org" <kgene@...nel.org>,
        "jonathanh@...dia.com" <jonathanh@...dia.com>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "baolu.lu@...ux.intel.com" <baolu.lu@...ux.intel.com>,
        "thierry.reding@...il.com" <thierry.reding@...il.com>,
        "bjorn.andersson@...aro.org" <bjorn.andersson@...aro.org>,
        "dwmw2@...radead.org" <dwmw2@...radead.org>,
        "m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
        "will@...nel.org" <will@...nel.org>,
        "jean-philippe@...aro.org" <jean-philippe@...aro.org>,
        "krzk@...nel.org" <krzk@...nel.org>,
        "robdclark@...il.com" <robdclark@...il.com>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        "gerald.schaefer@...ibm.com" <gerald.schaefer@...ibm.com>,
        "agross@...nel.org" <agross@...nel.org>,
        "linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>,
        "linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
        "linux-samsung-soc@...r.kernel.org" 
        <linux-samsung-soc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
        "linux-rockchip@...ts.infradead.org" 
        <linux-rockchip@...ts.infradead.org>,
        "linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "jroedel@...e.de" <jroedel@...e.de>
Subject: Re: [RFC PATCH 11/34] iommu: Split off default domain allocation
 from group assignment

Hi Jonathan,

On Mon, Apr 13, 2020 at 10:10:50PM +0000, Derrick, Jonathan wrote:
> I had to add the following for initial VMD support. The new PCIe domain
> added on VMD endpoint probe didn't have the dev_iommu member set on the
> VMD subdevices, which I'm guessing is due to probe_iommu_group already
> having been run on the VMD endpoint's group prior to those subdevices
> being added.
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 8a5e1ac328dd..ac1e4fb9bf48 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -1577,6 +1577,9 @@ static int iommu_bus_notifier(struct notifier_block *nb,
>         if (action == BUS_NOTIFY_ADD_DEVICE) {
>                 int ret;
>  
> +               if (!dev_iommu_get(dev))
> +                       return -ENOMEM;
> +
>                 ret = iommu_probe_device(dev);
>                 return (ret) ? NOTIFY_DONE : NOTIFY_OK;
>         } else if (action == BUS_NOTIFY_REMOVED_DEVICE) {

Right, thanks for catching this. The hotplug path does not allocate the
dev->iommu structure yet. I'll have to figure out if the above patch
adds it at the right place, but I'll fix it in the next version.

Thanks again,

	Joerg

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ