qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/5] accel/kvm: Fix SIGSEGV when execute "query-balloon" after CPR transfer
@ 2025-09-26  2:25 Zhenzhong Duan
  2025-09-26  4:48 ` Markus Armbruster
  2025-09-26 13:19 ` Steven Sistare
  0 siblings, 2 replies; 6+ messages in thread
From: Zhenzhong Duan @ 2025-09-26  2:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.williamson, clg, eric.auger, steven.sistare

After CPR transfer, source QEMU close kvm fd and free kvm_state,
"query-balloon" will check kvm_state->sync_mmu and trigger NULL
pointer reference.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 accel/kvm/kvm-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 9060599cd7..a3e2d11763 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -3479,7 +3479,7 @@ int kvm_device_access(int fd, int group, uint64_t attr,
 
 bool kvm_has_sync_mmu(void)
 {
-    return kvm_state->sync_mmu;
+    return kvm_state && kvm_state->sync_mmu;
 }
 
 int kvm_has_vcpu_events(void)
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-09-29  6:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-26  2:25 [PATCH 5/5] accel/kvm: Fix SIGSEGV when execute "query-balloon" after CPR transfer Zhenzhong Duan
2025-09-26  4:48 ` Markus Armbruster
2025-09-26 13:17   ` Steven Sistare
2025-09-28  8:13   ` Duan, Zhenzhong
2025-09-29  4:32     ` Markus Armbruster
2025-09-26 13:19 ` Steven Sistare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).