x86: get_page_from_gfn() must return NULL for invalid GFNs

... also in the non-translated case.

This is XSA-32 / CVE-2012-xxxx.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
This commit is contained in:
Jan Beulich committed 2012-12-04 18:02:59 +00:00
1 parent b1fab50952
commit f2ccf981be
1 file changed
+1 -1
+1 -1
View File
@@ -400,7 +400,7 @@ static inline struct page_info *get_page_from_gfn(
if (t)
*t = p2m_ram_rw;
page = __mfn_to_page(gfn);
return get_page(page, d) ? page : NULL;
return mfn_valid(gfn) && get_page(page, d) ? page : NULL;
}
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.