mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
4983e5c3b8
commit
5a8637ac0e
1 file changed
+2
-1
+2
-1
@@ -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;
|
||||
|
||||