[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160603145213.GA2889@x61s.reliablesolutions.de>
Date: Fri, 3 Jun 2016 16:52:13 +0200
From: Jan Niehusmann <jan@...dor.com>
To: linux-kernel@...r.kernel.org, Adam Morrison <mad@...technion.ac.il>
Cc: Omer Peleg <omer@...technion.ac.il>, Shaohua Li <shli@...com>,
Ben Serebrin <serebrin@...gle.com>,
David Woodhouse <David.Woodhouse@...el.com>
Subject: [PATCH] iommu/vt-d: fix overflow of iommu->domains array
The valid range of did in get_iommu_domain(*iommu, did)
is 0..cap_ndoms(iommu->cap), so don't exceed that
range in free_all_cpu_cached_iovas().
Signed-off-by: Jan Niehusmann <jan@...dor.com>
---
drivers/iommu/intel-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index a644d0c..82989d4 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4600,7 +4600,7 @@ static void free_all_cpu_cached_iovas(unsigned int cpu)
if (!iommu)
continue;
- for (did = 0; did < 0xffff; did++) {
+ for (did = 0; did < cap_ndoms(iommu->cap); did++) {
domain = get_iommu_domain(iommu, did);
if (!domain)
--
2.1.4
Powered by blists - more mailing lists