All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: syzbot <syzbot+760a73552f47a8cd0fd9@syzkaller.appspotmail.com>,
	Gleb Natapov <gleb@redhat.com>, Avi Kivity <avi@redhat.com>,
	syzkaller-bugs@googlegroups.com
Cc: "H. Peter Anvin" <hpa@zytor.com>, kvm <kvm@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Radim Krcmar <rkrcmar@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	the arch/x86 maintainers <x86@kernel.org>,
	Wanpeng Li <kernellwp@gmail.com>
Subject: Re: WARNING in kvm_arch_vcpu_ioctl_run (3)
Date: Wed, 22 Jun 2022 11:46:56 +0900	[thread overview]
Message-ID: <e3a1a213-ea9f-dbd8-93be-74e927794090@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <CANRm+Cz9GEhgc_Na3E8DqYBccPTimybeu+idP1hDJSk4jni7ag@mail.gmail.com>

On 2018/03/28 16:29, Wanpeng Li wrote:
>> syzbot dashboard link:
>> https://syzkaller.appspot.com/bug?extid=760a73552f47a8cd0fd9
>>
> Maybe the same as this one. https://lkml.org/lkml/2018/3/21/174 Paolo,
> any idea against my analysis?

No progress for 4 years. Did somebody check Wanpeng's analysis ?

Since I'm not familiar with KVM, my questions from different direction...



syzbot is hitting WARN_ON(vcpu->arch.pio.count || vcpu->mmio_needed) added by
commit 716d51abff06f484 ("KVM: Provide userspace IO exit completion callback")
due to vcpu->mmio_needed == true.

Question 1: what is the intent of checking for vcpu->mmio_needed == false?



If we run a reproducer provided by syzbot, we can observe that mutex_unlock(&vcpu->mutex)
in kvm_vcpu_ioctl() is called with vcpu->mmio_needed == true.

Question 2: Is kvm_vcpu_ioctl() supposed to leave with vcpu->mmio_needed == false?
In other words, is doing

--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4104,6 +4104,7 @@ static long kvm_vcpu_ioctl(struct file *filp,
 		r = kvm_arch_vcpu_ioctl(filp, ioctl, arg);
 	}
 out:
+	WARN_ON_ONCE(vcpu->mmio_needed);
 	mutex_unlock(&vcpu->mutex);
 	kfree(fpu);
 	kfree(kvm_sregs);

appropriate?

  reply	other threads:[~2022-06-22  2:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  7:13 WARNING in kvm_arch_vcpu_ioctl_run (3) syzbot
2018-03-28  7:29 ` Wanpeng Li
2022-06-22  2:46   ` Tetsuo Handa [this message]
2022-06-27 20:08     ` Sean Christopherson
2018-10-02 21:07 ` syzbot
2019-04-14 11:06 ` syzbot
2019-06-17  2:55 ` syzbot

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=e3a1a213-ea9f-dbd8-93be-74e927794090@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=syzbot+760a73552f47a8cd0fd9@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 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.