]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/vt-d: Fix overflow of iommu->domains array
authorJan Niehusmann <jan@gondor.com>
Mon, 6 Jun 2016 12:20:11 +0000 (14:20 +0200)
committerJoerg Roedel <jroedel@suse.de>
Mon, 27 Jun 2016 11:21:37 +0000 (13:21 +0200)
commit70b1c615d900cb9c135b7e7bf7be431f6d310689
treea2aa2e26e7fb976169baaa54d09877e99ae6ed7d
parenta10b9ea944a596e312a53d4c36b7a5cb578bb09d
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().

The user-visible impact of the out-of-bounds access is the machine
hanging on suspend-to-ram. It is, in fact, a kernel panic, but due
to already suspended devices, that's often not visible to the user.

Fixes: 93ec91365927 ("iommu/vt-d: Use per-cpu IOVA caching")
Signed-off-by: Jan Niehusmann <jan@gondor.com>
Tested-By: Marius Vlad <marius.c.vlad@intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c