]> git.baikalelectronics.ru Git - kernel.git/commit
iommu: Make sysfs robust for non-API groups
authorRobin Murphy <robin.murphy@arm.com>
Wed, 4 May 2022 12:39:58 +0000 (13:39 +0100)
committerJoerg Roedel <jroedel@suse.de>
Wed, 4 May 2022 13:13:39 +0000 (15:13 +0200)
commit4023668bcf7e7194c45f4f055bc30281978d673e
tree39ebe565ec6b50fddc321f46bfae3a87e9feee9c
parentb320606c2e3bc372eaf24ab1edc01185ac358014
iommu: Make sysfs robust for non-API groups

Groups created by VFIO backends outside the core IOMMU API should never
be passed directly into the API itself, however they still expose their
standard sysfs attributes, so we can still stumble across them that way.
Take care to consider those cases before jumping into our normal
assumptions of a fully-initialised core API group.

Fixes: 8bec16b5b7cf ("iommu: Use right way to retrieve iommu_ops")
Reported-by: Jan Stancek <jstancek@redhat.com>
Tested-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/86ada41986988511a8424e84746dfe9ba7f87573.1651667683.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c