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

[Xen-changelog] [xen stable-4.2] x86-64: check for canonical address before doing page walks



commit a489633284ce1e7d6e48011f198e71351213ecb2
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Oct 22 12:07:40 2013 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Oct 22 12:07:40 2013 +0200

    x86-64: check for canonical address before doing page walks
    
    ... as there doesn't really exists any valid mapping for them.
    
    Particularly in the case of do_page_walk() this also avoids returning
    non-NULL for such invalid input.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
    master commit: 6fd9b0361e2eb5a7f12bdd5cbf7e42c0d1937d26
    master date: 2013-10-11 09:31:16 +0200
---
 xen/arch/x86/x86_64/mm.c    |    2 +-
 xen/arch/x86/x86_64/traps.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 635a499..02cb7a9 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -145,7 +145,7 @@ void *do_page_walk(struct vcpu *v, unsigned long addr)
     l2_pgentry_t l2e, *l2t;
     l1_pgentry_t l1e, *l1t;
 
-    if ( is_hvm_vcpu(v) )
+    if ( is_hvm_vcpu(v) || !is_canonical_address(addr) )
         return NULL;
 
     l4t = mfn_to_virt(mfn);
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index 00bee9b..d20e528 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -169,6 +169,8 @@ void show_page_walk(unsigned long addr)
     l1_pgentry_t l1e, *l1t;
 
     printk("Pagetable walk from %016lx:\n", addr);
+    if ( !is_canonical_address(addr) )
+        return;
 
     l4t = mfn_to_virt(mfn);
     l4e = l4t[l4_table_offset(addr)];
--
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®.