public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <12o3l-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
To: avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH] check shadow_pte == NULL in FNAME(page_fault); drivers/kvm/paging_tmpl.h
Date: Fri, 16 Nov 2007 21:55:08 +0100	[thread overview]
Message-ID: <473E03AC.3000403@tiscali.nl> (raw)

#------------------------------------------------------------------------------#
in function FNAME(page_fault), drivers/kvm/paging_tmpl.h, line 450, (linus' git)

I think a check is in place. I am not sure whether this is how it should be
done, nor was the patch below tested. So please review.
--
The u64 pointer shadow_pte is initialized by the function FNAME(fetch), but
FNAME(fetch) can return NULL,

Signed-off-by: Roel Kluin <12o3l-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
---
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 4b5391c..fce305d 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -460,7 +460,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
 	/*
 	 * mmio: emulate if accessible, otherwise its a guest fault.
 	 */
-	if (is_io_pte(*shadow_pte))
+	if (!shadow_pte || is_io_pte(*shadow_pte))
 		return 1;
 
 	++vcpu->stat.pf_fixed;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

             reply	other threads:[~2007-11-16 20:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-16 20:55 Roel Kluin [this message]
     [not found] ` <473E03AC.3000403-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
2007-11-18 11:02   ` [PATCH] check shadow_pte == NULL in FNAME(page_fault); drivers/kvm/paging_tmpl.h Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=473E03AC.3000403@tiscali.nl \
    --to=12o3l-iwqwacnznjzz+pzb47itoq@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox