39 lines
1.2 KiB
Diff
39 lines
1.2 KiB
Diff
|
# Commit 6fd9b0361e2eb5a7f12bdd5cbf7e42c0d1937d26
|
||
|
# Date 2013-10-11 09:31:16 +0200
|
||
|
# Author Jan Beulich <jbeulich@suse.com>
|
||
|
# Committer Jan Beulich <jbeulich@suse.com>
|
||
|
x86: 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@citrix.com>
|
||
|
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
||
|
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
|
||
|
Acked-by: Keir Fraser <keir@xen.org>
|
||
|
|
||
|
--- a/xen/arch/x86/x86_64/mm.c
|
||
|
+++ b/xen/arch/x86/x86_64/mm.c
|
||
|
@@ -135,7 +135,7 @@ void *do_page_walk(struct vcpu *v, unsig
|
||
|
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 = map_domain_page(mfn);
|
||
|
--- 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 = map_domain_page(mfn);
|
||
|
l4e = l4t[l4_table_offset(addr)];
|