Re: [PATCH] KVM: Add missing debugfs cleanup in kvm_init error path

From: Sean Christopherson

Date: Thu Jul 09 2026 - 12:54:56 EST


On Thu, Jul 09, 2026, Steffen Eiden wrote:
> If any initialization after kvm_init_debug() fails the cleanup code did
> not remove the debugfs entries. Therefore, the corresponding debugfs
> entries where still alive but the backing fops are already freed,
> creating a use-after-free scenario. Fix this by removing the debugfs
> entries if vfio init fails.

Already posted, and applied locally on my end.

https://lore.kernel.org/all/20260706095910.39798-1-leixiang%40kylinos.cn