diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-08-14 11:20:26 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-08-14 11:20:26 +0200 |
commit | f67af6d5803b6a015e30cb490a94f9547cb0437c (patch) | |
tree | 08dc842311b5a70512747fe7c75b9bd40a06e1b9 /xen/arch/x86/cpu | |
parent | 78742c233c664cac6cac8405c154f82239ab6995 (diff) | |
download | xen-f67af6d5803b6a015e30cb490a94f9547cb0437c.tar.gz xen-f67af6d5803b6a015e30cb490a94f9547cb0437c.tar.bz2 xen-f67af6d5803b6a015e30cb490a94f9547cb0437c.zip |
x86/MTRR: fix range check in mtrr_add_page()
Extracted from Yinghai Lu's Linux commit d5c78673 ("x86: Fix /proc/mtrr
with base/size more than 44bits").
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/cpu')
-rw-r--r-- | xen/arch/x86/cpu/mtrr/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c index a201d72b6d..f7fc0a6e4b 100644 --- a/xen/arch/x86/cpu/mtrr/main.c +++ b/xen/arch/x86/cpu/mtrr/main.c @@ -340,7 +340,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, return -EINVAL; } - if (base & size_or_mask || size & size_or_mask) { + if ((base | (base + size - 1)) >> (paddr_bits - PAGE_SHIFT)) { printk(KERN_WARNING "mtrr: base or size exceeds the MTRR width\n"); return -EINVAL; } |