Re: [PATCH RESEND 1/2] KVM: Prevent module exit until all VMs are freed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 3/15/22 16:43, Murilo Opsfelder Araújo wrote:

+    if (!try_module_get(kvm_chardev_ops.owner)) {
+        r = -ENODEV;
+        goto out_err;
+    }
+

Doesn't this problem also affects the other functions called from
kvm_dev_ioctl()?

Is it possible that the module is removed while other ioctl's are
still running, e.g. KVM_GET_API_VERSION and KVM_CHECK_EXTENSION, even
though they don't use struct kvm?

No, because opening /dev/kvm also adds a reference to the module. The problem is that create_vm creates another source of references to the module that can survive after /dev/kvm is closed.

Paolo




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux