]> 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)
commitf0e2d816162c0ff7c9db94f5ad03bbb19ebd60eb
treea2aa2e26e7fb976169baaa54d09877e99ae6ed7d
parent176c584a6c650f624257f90aab00ed2965bbd2a9
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: e43fdb80409f ("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