* [PATCH] hw/virtio: fix crash on kill then start vhost backend
@ 2021-08-30 12:08 Yuwei Zhang
0 siblings, 0 replies; only message in thread
From: Yuwei Zhang @ 2021-08-30 12:08 UTC (permalink / raw)
To: qemu-devel; +Cc: zhangyuwei.9149
Add flatview update in vhost_user_cleanup() to avoid access
unmapped memory which may cause a qemu crash.
Signed-off-by: Yuwei Zhang <zhangyuwei.9149@bytedance.com>
---
hw/virtio/vhost-user.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 2407836fac..b6e76985b7 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -2423,6 +2423,7 @@ void vhost_user_cleanup(VhostUserState *user)
return;
}
+ memory_region_transaction_begin();
for (i = 0; i < VIRTIO_QUEUE_MAX; i++) {
if (user->notifier[i].addr) {
object_unparent(OBJECT(&user->notifier[i].mr));
@@ -2430,6 +2431,7 @@ void vhost_user_cleanup(VhostUserState *user)
user->notifier[i].addr = NULL;
}
}
+ memory_region_transaction_commit();
user->chr = NULL;
}
--
2.11.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-30 13:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-30 12:08 [PATCH] hw/virtio: fix crash on kill then start vhost backend Yuwei Zhang
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).