From: Maxim Levitsky <mlevitsk@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] KVM: x86: fix uninitialized variable use on KVM_REQ_TRIPLE_FAULT
Date: Wed, 30 Nov 2022 19:35:18 +0200 [thread overview]
Message-ID: <421c98ac2f863703795c8783090f645744673130.camel@redhat.com> (raw)
In-Reply-To: <20221130161531.891135-1-pbonzini@redhat.com>
On Wed, 2022-11-30 at 11:15 -0500, Paolo Bonzini wrote:
> If a triple fault was fixed by kvm_x86_ops.nested_ops->triple_fault (by
> turning it into a vmexit), there is no need to leave vcpu_enter_guest().
> Any vcpu->requests will be caught later before the actual vmentry,
> and in fact vcpu_enter_guest() was not initializing the "r" variable.
> Depending on the compiler's whims, this could cause the
> x86_64/triple_fault_event_test test to fail.
>
> Cc: Maxim Levitsky <mlevitsk@redhat.com>
> Fixes: 92e7d5c83aff ("KVM: x86: allow L1 to not intercept triple fault")
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> arch/x86/kvm/x86.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 246bdc9a9154..7f850dfb4086 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -10280,8 +10280,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
> vcpu->run->exit_reason = KVM_EXIT_SHUTDOWN;
> vcpu->mmio_needed = 0;
> r = 0;
> + goto out;
> }
> - goto out;
> }
> if (kvm_check_request(KVM_REQ_APF_HALT, vcpu)) {
> /* Page is swapped out. Do synthetic halt */
I had the same patch waiting to be sent, so:
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
But we need to add the orignal reporter of this bug as well:
Reported-by: Dan Carpenter <error27@gmail.com>
Best regards,
Maxim Levitsky
prev parent reply other threads:[~2022-11-30 17:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 16:15 Paolo Bonzini
2022-11-30 17:35 ` Maxim Levitsky [this message]
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=421c98ac2f863703795c8783090f645744673130.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=error27@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®