* [PATCH 5.15-stable v2] iommu: fix a reference count leak in iommu_sva_bind_device()
@ 2026-03-19 14:51 vsntk18
0 siblings, 0 replies; only message in thread
From: vsntk18 @ 2026-03-19 14:51 UTC (permalink / raw)
To: gregkh, stable
Cc: baolu.lu, black.hawk, jgg, joro, Vasant Karasulli,
Vasant Karasulli
From: Vasant Karasulli <vsntk18@gmail.com>
commit b34289505180 ("iommu: disable SVA when CONFIG_X86 is set")
disables SVA to mitigate a security vulnerability.
Due the current placement of the condition check,
function returns after iommu_group_get() without a corresponding
iommu_group_put(). So move the condition check above.
This is a stable-only fix applicable to linux-5.15.y.
Fixes: b34289505180 ("iommu: disable SVA when CONFIG_X86 is set")
Signed-off-by: Vasant Karasulli <vkarasulli@suse.de>
---
v2:
- addressed formatting mistakes in the changelog
drivers/iommu/iommu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 964170f90597..25119d75537c 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -3061,6 +3061,9 @@ iommu_sva_bind_device(struct device *dev, struct mm_struct *mm, void *drvdata)
struct iommu_sva *handle = ERR_PTR(-EINVAL);
const struct iommu_ops *ops = dev->bus->iommu_ops;
+ if (IS_ENABLED(CONFIG_X86))
+ return ERR_PTR(-EOPNOTSUPP);
+
if (!ops || !ops->sva_bind)
return ERR_PTR(-ENODEV);
@@ -3068,9 +3071,6 @@ iommu_sva_bind_device(struct device *dev, struct mm_struct *mm, void *drvdata)
if (!group)
return ERR_PTR(-ENODEV);
- if (IS_ENABLED(CONFIG_X86))
- return ERR_PTR(-EOPNOTSUPP);
-
/* Ensure device count and domain don't change while we're binding */
mutex_lock(&group->mutex);
base-commit: 3330a8d33e086f76608bb4e80a3dc569d04a8814
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-19 14:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 14:51 [PATCH 5.15-stable v2] iommu: fix a reference count leak in iommu_sva_bind_device() vsntk18
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox