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>
This commit is contained in:
Keir Fraser committed 2008-03-19 10:15:01 +00:00
1 parent 4983e5c3b8
commit 5a8637ac0e
1 file changed
+2 -1
+2 -1
View File
@@ -645,7 +645,7 @@ get_page_from_l1e(
struct page_info *page = mfn_to_page(mfn);
uint32_t l1f = l1e_get_flags(l1e);
struct vcpu *curr = current;
struct domain *owner = page_get_owner(page);
struct domain *owner;
int okay;
if ( !(l1f & _PAGE_PRESENT) )
@@ -680,6 +680,7 @@ get_page_from_l1e(
* until pvfb supports granted mappings. At that time this minor hack
* can go away.
*/
owner = page_get_owner(page);
if ( unlikely(d != owner) && (owner != NULL) &&
(d != curr->domain) && IS_PRIV_FOR(d, owner) )
d = owner;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.