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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a3ebe9b-518e-49ef-b87d-925d951a446f@kernel.org>
Date: Mon, 29 Sep 2025 10:23:47 +0200
From: Hans Verkuil <hverkuil+cisco@...nel.org>
To: iommu@...ts.linux.dev
Cc: Linux Kernel <linux-kernel@...r.kernel.org>,
 Linux Media Mailing List <linux-media@...r.kernel.org>,
 Laurent Pinchart <laurent.pinchart@...asonboard.com>,
 Jason Gunthorpe <jgg@...dia.com>, Jason Gunthorpe <jgg@...dia.com>
Subject: [PATCH] iommu: __iommu_attach_group: check for non-NULL
 blocking_domain

Loading the omap3isp driver fails in __iommu_attach_group:
group->blocking_domain is NULL, and so the check
group->domain != group->blocking_domain is always true and it
returns -EBUSY.

Only return -EBUSY if group->blocking_domain is non-NULL.

Signed-off-by: Hans Verkuil <hverkuil+cisco@...nel.org>
Fixes: 0286300e6045 ("iommu: iommu_group_claim_dma_owner() must always assign a domain")
---
Since I am unfamiliar with the iommu core code, I am uncertain whether I am
just papering over a bug elsewhere, or whether this is really the correct solution.

The omap3isp code in question is here:

drivers/media/platform/ti/omap3isp/isp.c, function isp_attach_iommu().

This omap3isp code predates the addition of blocking_domain and it used to work
before that feature was added.

I've tested this patch with my Beagle XM board.

If this patch is addressing the issue in the wrong place, then advise
on what the correct solution is would be very much appreciated!

I have a bunch of media omap3isp cleanup patches pending, but there is no point in
posting those until this issue is resolved.

Regards,

	Hans
---
 drivers/iommu/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 060ebe330ee1..0ab1671ee850 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -2220,7 +2220,7 @@ static int __iommu_attach_group(struct iommu_domain *domain,
 	struct device *dev;

 	if (group->domain && group->domain != group->default_domain &&
-	    group->domain != group->blocking_domain)
+	    group->blocking_domain && group->domain != group->blocking_domain)
 		return -EBUSY;

 	dev = iommu_group_first_dev(group);
-- 
2.47.2



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ