Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1413281
| From | Jan Niehusmann <jan@gondor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] iommu/vt-d: fix overflow of iommu->domains array |
| Date | 2016-06-03 17:00 +0200 |
| Message-ID | <rFYJP-4Ab-11@gated-at.bofh.it> (permalink) |
| References | <rFyFI-5bR-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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@gondor.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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Suspend broken on Thinkpad x201s since 4.7-rc1 Jan Niehusmann <jan@gondor.com> - 2016-06-02 13:10 +0200 [PATCH] iommu/vt-d: fix overflow of iommu->domains array Jan Niehusmann <jan@gondor.com> - 2016-06-03 17:00 +0200
csiph-web