[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53cc074f-350f-5fa8-1ee4-c33921f17cb1@redhat.com>
Date: Fri, 25 Mar 2022 17:50:14 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Pavel Skripkin <paskripkin@...il.com>, seanjc@...gle.com,
vkuznets@...hat.com, wanpengli@...cent.com, jmattson@...gle.com
Cc: x86@...nel.org, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
syzbot+717ed82268812a643b28@...kaller.appspotmail.com
Subject: Re: [RFC PATCH] KVM: x86/mmu: fix general protection fault in
kvm_mmu_uninit_tdp_mmu
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
Powered by blists - more mailing lists