* [PATCH] iommu/arm-smmu: Check that iommu_fwspecs are ours
@ 2016-11-02 17:31 Robin Murphy
2016-11-03 20:37 ` Joerg Roedel
0 siblings, 1 reply; 2+ messages in thread
From: Robin Murphy @ 2016-11-02 17:31 UTC (permalink / raw)
To: linux-arm-kernel
We seem to have forgotten to check that iommu_fwspecs actually belong to
us before we go ahead and dereference their private data. Oops.
Fixes: 021bb8420d44 ("iommu/arm-smmu: Wire up generic configuration support")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
drivers/iommu/arm-smmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index ef978db2bb54..ef0f8d635a3b 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1390,7 +1390,7 @@ static int arm_smmu_add_device(struct device *dev)
fwspec = dev->iommu_fwspec;
if (ret)
goto out_free;
- } else if (fwspec) {
+ } else if (fwspec && fwspec->ops == &arm_smmu_ops) {
smmu = arm_smmu_get_by_node(to_of_node(fwspec->iommu_fwnode));
} else {
return -ENODEV;
--
2.10.2.dirty
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] iommu/arm-smmu: Check that iommu_fwspecs are ours
2016-11-02 17:31 [PATCH] iommu/arm-smmu: Check that iommu_fwspecs are ours Robin Murphy
@ 2016-11-03 20:37 ` Joerg Roedel
0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2016-11-03 20:37 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 02, 2016 at 05:31:32PM +0000, Robin Murphy wrote:
> We seem to have forgotten to check that iommu_fwspecs actually belong to
> us before we go ahead and dereference their private data. Oops.
>
> Fixes: 021bb8420d44 ("iommu/arm-smmu: Wire up generic configuration support")
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
> drivers/iommu/arm-smmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)a
Applied to iommu/fixes, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-03 20:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-02 17:31 [PATCH] iommu/arm-smmu: Check that iommu_fwspecs are ours Robin Murphy
2016-11-03 20:37 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).