[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.2] x86/MTRR: fix range check in mtrr_add_page()



commit d1eca89587990c47edf54091dabe187d8317bafb
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Aug 20 15:39:07 2013 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Aug 20 15:39:07 2013 +0200

    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@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
    master commit: f67af6d5803b6a015e30cb490a94f9547cb0437c
    master date: 2013-08-14 11:20:26 +0200
---
 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 45d0898..2b3d29f 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -350,7 +350,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;
        }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.