mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Pavel Skripkin <paskripkin@gmail.com>,
	seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com,
	jmattson@google.com
Cc: x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	syzbot+717ed82268812a643b28@syzkaller.appspotmail.com
Subject: Re: [RFC PATCH] KVM: x86/mmu: fix general protection fault in kvm_mmu_uninit_tdp_mmu
Date: Fri, 25 Mar 2022 17:50:14 +0100	[thread overview]
Message-ID: <53cc074f-350f-5fa8-1ee4-c33921f17cb1@redhat.com> (raw)
In-Reply-To: <20220325163815.3514-1-paskripkin@gmail.com>

On 3/25/22 17:38, Pavel Skripkin wrote:
> Syzbot reported GPF in kvm_mmu_uninit_tdp_mmu(), which is caused by
> passing NULL pointer to flush_workqueue().
> 
> tdp_mmu_zap_wq is allocated via alloc_workqueue() which may fail. There
> is no error hanling and kvm_mmu_uninit_tdp_mmu() return value is simply
> ignored. Even all kvm_*_init_vm() functions are void, so the easiest
> solution is to check that tdp_mmu_zap_wq is valid pointer before passing
> it somewhere.

Thanks for the analysis, but not scheduling the work item in 
tdp_mmu_schedule_zap_root is broken; you can't just let the roots 
survive (KVM uses its own workqueue because it needs to work item to 
complete has to flush it before kvm_mmu_zap_all_fast returns).

I'll fix it properly by propagating the error up to kvm_mmu_init_vm and 
kvm_arch_init_vm,

Thanks,

Paolo


  parent reply	other threads:[~2022-03-25 16:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 16:38 Pavel Skripkin
2022-03-25 16:46 ` Christophe JAILLET
2022-03-25 16:50 ` Paolo Bonzini [this message]
2022-03-25 18:11   ` Pavel Skripkin

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=53cc074f-350f-5fa8-1ee4-c33921f17cb1@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paskripkin@gmail.com \
    --cc=seanjc@google.com \
    --cc=syzbot+717ed82268812a643b28@syzkaller.appspotmail.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --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 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®