[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-3.4-testing] x86: add an extra check when validating a huge pv L2 entry
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1254409538 -3600 # Node ID e34a589a1bc896fb9582a1387f99cda5a1624807 # Parent c3767592b4a84987f9b0df87b554262ea9d00845 x86: add an extra check when validating a huge pv L2 entry While get_page_and_type_from_pagenr() (through get_page_from_pagenr()) does the needed mfn_valid() check, get_data_page() doesn't and, it being passed a struct page_info pointer, really expects it's caller(s) to do. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx> Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx> xen-unstable changeset: 20189:d2a32e24fe50 xen-unstable date: Wed Sep 09 16:39:41 2009 +0100 --- xen/arch/x86/mm.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff -r c3767592b4a8 -r e34a589a1bc8 xen/arch/x86/mm.c --- a/xen/arch/x86/mm.c Thu Oct 01 16:00:10 2009 +0100 +++ b/xen/arch/x86/mm.c Thu Oct 01 16:05:38 2009 +0100 @@ -844,14 +844,16 @@ get_page_from_l2e( int writeable = !!(l2e_get_flags(l2e) & _PAGE_RW); do { - rc = get_data_page(mfn_to_page(m), d, writeable); - if ( unlikely(!rc) ) + if ( !mfn_valid(m) || + !get_data_page(mfn_to_page(m), d, writeable) ) { while ( m-- > mfn ) put_data_page(mfn_to_page(m), writeable); return -EINVAL; } } while ( m++ < (mfn + (L1_PAGETABLE_ENTRIES-1)) ); + + rc = 1; #ifdef __x86_64__ map_pages_to_xen( _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |