diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-11-26 09:42:10 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-16 06:59:31 -0800 |
commit | 4ce9fbccfb9ee64bec6ac125150e2beac5f0c42f (patch) | |
tree | ef1d81a1d2d7e332eac061448167dfb7f36aa41e /drivers/thermal | |
parent | e69001acba6725963d0bc5476ec380f56bd65932 (diff) |
iommu/vt-d: Fix an off-by-one bug in __domain_mapping()
commit cc4f14aa170d895c9a43bdb56f62070c8a6da908 upstream.
There's an off-by-one bug in function __domain_mapping(), which may
trigger the BUG_ON(nr_pages < lvl_pages) when
(nr_pages + 1) & superpage_mask == 0
The issue was introduced by commit 9051aa0268dc "intel-iommu: Combine
domain_pfn_mapping() and domain_sg_mapping()", which sets sg_res to
"nr_pages + 1" to avoid some of the 'sg_res==0' code paths.
It's safe to remove extra "+1" because sg_res is only used to calculate
page size now.
Reported-And-Tested-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-By: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thermal')
0 files changed, 0 insertions, 0 deletions