All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: add an extra check when validating a huge pv L2 entry
@ 2009-09-09 15:19 Jan Beulich
  2009-09-09 15:35 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2009-09-09 15:19 UTC (permalink / raw)
  To: xen-devel

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@novell.com>

--- 2009-08-18.orig/xen/arch/x86/mm.c	2009-09-09 13:32:06.000000000 +0200
+++ 2009-08-18/xen/arch/x86/mm.c	2009-09-09 13:35:02.000000000 +0200
@@ -868,7 +868,10 @@ get_page_from_l2e(
         int writeable = !!(l2e_get_flags(l2e) & _PAGE_RW);
   
         do {
-            rc = get_data_page(mfn_to_page(m), d, writeable);
+            if ( mfn_valid(m) )
+                rc = get_data_page(mfn_to_page(m), d, writeable);
+            else
+                rc = -EINVAL;
             if ( unlikely(!rc) )
             {
                 while ( m-- > mfn )

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-09 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09 15:19 [PATCH] x86: add an extra check when validating a huge pv L2 entry Jan Beulich
2009-09-09 15:35 ` Keir Fraser
2009-09-09 15:51   ` Jan Beulich
2009-09-09 16:15     ` Michael J Coss
2009-09-09 17:35       ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.