* [PATCH] vfio/virtio: Fix lock/unlock mismatch in virtiovf_read_device_context_chunk()
@ 2026-04-13 6:52 Jinhui Guo
0 siblings, 0 replies; only message in thread
From: Jinhui Guo @ 2026-04-13 6:52 UTC (permalink / raw)
To: Alex Williamson, Jason Gunthorpe, Yishai Hadas, Shameer Kolothum,
Kevin Tian
Cc: kvm, virtualization, linux-kernel, Jinhui Guo
virtiovf_read_device_context_chunk() takes migf->list_lock with
spin_lock() but releases it with spin_unlock_irq(). This mismatch
can incorrectly enable interrupts if they were already disabled
when the lock was acquired, leading to unbalanced IRQ state.
Fix by using spin_lock_irq() to match spin_unlock_irq().
Fixes: 0bbc82e4ec79 ("vfio/virtio: Add support for the basic live migration functionality")
Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
---
drivers/vfio/pci/virtio/migrate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vfio/pci/virtio/migrate.c b/drivers/vfio/pci/virtio/migrate.c
index 35fa2d6ed611..9fc24788fc04 100644
--- a/drivers/vfio/pci/virtio/migrate.c
+++ b/drivers/vfio/pci/virtio/migrate.c
@@ -621,7 +621,7 @@ virtiovf_read_device_context_chunk(struct virtiovf_migration_file *migf,
buf->start_pos = buf->migf->max_pos;
migf->max_pos += buf->length;
- spin_lock(&migf->list_lock);
+ spin_lock_irq(&migf->list_lock);
list_add_tail(&buf->buf_elm, &migf->buf_list);
spin_unlock_irq(&migf->list_lock);
return 0;
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-13 6:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13 6:52 [PATCH] vfio/virtio: Fix lock/unlock mismatch in virtiovf_read_device_context_chunk() Jinhui Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox