All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: gleb@kernel.org, pbonzini@redhat.com, x86@kernel.org,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RTF] kvm:x86:Fix error checking in the function pf_interception
Date: Fri, 7 Aug 2015 09:31:01 +0200	[thread overview]
Message-ID: <20150807073101.GT14980@8bytes.org> (raw)
In-Reply-To: <1438913423-30959-1-git-send-email-xerofoify@gmail.com>

On Thu, Aug 06, 2015 at 10:10:23PM -0400, Nicholas Krause wrote:
> This fixes error checking in the function pf_interception by
> checking if the call to kvm_mmu_unprotect_page_virt returns
> zero to indicate the function has failed internally and if
> this occurs we must return immediately to the caller of the
> function pf_interception with the return value of zero from
> the call to the function kvm_mmu_unprotect_page_virt to indicate
> failure to the caller of the function pf_interception.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  arch/x86/kvm/svm.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 8e0c084..a57aee1 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -1814,8 +1814,11 @@ static int pf_interception(struct vcpu_svm *svm)
>  		error_code = svm->vmcb->control.exit_info_1;
>  
>  		trace_kvm_page_fault(fault_address, error_code);
> -		if (!npt_enabled && kvm_event_needs_reinjection(&svm->vcpu))
> -			kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address);
> +		if (!npt_enabled && kvm_event_needs_reinjection(&svm->vcpu)) {
> +			r = kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address);
> +			if (!r)
> +				break;
> +		}

NAK. kvm_mmu_unprotect_page_virt does not return an error but whether it
unprotected a page or not. This patch breaks SVM.

           reply	other threads:[~2015-08-07  7:31 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1438913423-30959-1-git-send-email-xerofoify@gmail.com>]

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=20150807073101.GT14980@8bytes.org \
    --to=joro@8bytes.org \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=x86@kernel.org \
    --cc=xerofoify@gmail.com \
    /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 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.