ia64/xen-unstable

changeset 17261:4af873c95d0b

x86: Avoid dereference of 'struct page_info' for invalid MFNs.
Introduced by my changes to Samuel's transitive-privilege patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 19 10:15:01 2008 +0000 (2008-03-19)
parents 0901aec1d00b
children c69524c462ff
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Mar 19 00:01:25 2008 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Wed Mar 19 10:15:01 2008 +0000
     1.3 @@ -645,7 +645,7 @@ get_page_from_l1e(
     1.4      struct page_info *page = mfn_to_page(mfn);
     1.5      uint32_t l1f = l1e_get_flags(l1e);
     1.6      struct vcpu *curr = current;
     1.7 -    struct domain *owner = page_get_owner(page);
     1.8 +    struct domain *owner;
     1.9      int okay;
    1.10  
    1.11      if ( !(l1f & _PAGE_PRESENT) )
    1.12 @@ -680,6 +680,7 @@ get_page_from_l1e(
    1.13       * until pvfb supports granted mappings. At that time this minor hack
    1.14       * can go away.
    1.15       */
    1.16 +    owner = page_get_owner(page);
    1.17      if ( unlikely(d != owner) && (owner != NULL) &&
    1.18           (d != curr->domain) && IS_PRIV_FOR(d, owner) )
    1.19          d = owner;