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, 7 Jul 2022 10:58:56 +0100
From:   Robin Murphy <robin.murphy@....com>
To:     "Tian, Kevin" <kevin.tian@...el.com>,
        "joro@...tes.org" <joro@...tes.org>
Cc:     "will@...nel.org" <will@...nel.org>,
        "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "baolu.lu@...ux.intel.com" <baolu.lu@...ux.intel.com>,
        "suravee.suthikulpanit@....com" <suravee.suthikulpanit@....com>,
        "vasant.hegde@....com" <vasant.hegde@....com>,
        "mjrosato@...ux.ibm.com" <mjrosato@...ux.ibm.com>,
        "gerald.schaefer@...ux.ibm.com" <gerald.schaefer@...ux.ibm.com>,
        "schnelle@...ux.ibm.com" <schnelle@...ux.ibm.com>,
        "linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 03/15] iommu: Always register bus notifiers

On 2022-07-07 07:31, Tian, Kevin wrote:
>> From: Robin Murphy <robin.murphy@....com>
>> Sent: Wednesday, July 6, 2022 1:08 AM
>>
>> The number of bus types that the IOMMU subsystem deals with is small and
>> manageable, so pull that list into core code as a first step towards
>> cleaning up all the boilerplate bus-awareness from drivers. Calling
>> iommu_probe_device() before bus->iommu_ops is set will simply return
>> -ENODEV and not break the notifier call chain, so there should be no
>> harm in proactively registering all our bus notifiers at init time.
>>
> 
> Suppose we miss a check on iommu ops in iommu_release_device():
> 
> 	if (!dev->iommu) <<<<<<<
> 		return;
> 
> 	iommu_device_unlink(dev->iommu->iommu_dev, dev);
> 
> 	ops = dev_iommu_ops(dev);
> 	ops->release_device(dev);
> 
> following the rationale in patch01 a device could be removed when
> it's associated with a known but not registered instance.

No, because at that point the instance is only known internally to the 
driver. As long as it isn't erroneously returned from 
->probe_device(dev), dev->iommu will remain NULL and the rest of the 
core code works as expected.

Thanks,
Robin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ