[libvirt PATCH v2] remote: add mutex when freeing private callbacks

Martin Kletzander mkletzan at redhat.com
Tue Mar 7 21:00:10 UTC 2023


On Tue, Mar 07, 2023 at 05:57:56PM +0000, Mike Pontillo wrote:
>This commit resolves illegal memory accesses observed via:
>
>  remoteClientFreePrivateCallbacks()
>  remoteClientCloseFunc()
>  virNetServerClientCloseLocked()
>  virNetServerProcessClients()
>  daemonServerProcessClients()
>  virHashForEach()
>  virNetDaemonRun()
>  main()
>
>Signed-off-by: Mike Pontillo <mpontillo at digitalocean.com>

Reviewed-by: Martin Kletzander <mkletzan at redhat.com>

Thanks for the patch and congratulation on your first upstream libvirt
commit contribution ;)

>---
> src/remote/remote_daemon_dispatch.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
>index 250eb51e6b..0d843d63f6 100644
>--- a/src/remote/remote_daemon_dispatch.c
>+++ b/src/remote/remote_daemon_dispatch.c
>@@ -1709,6 +1709,8 @@ static void
> remoteClientFreePrivateCallbacks(struct daemonClientPrivate *priv)
> {
>     g_autoptr(virIdentity) sysident = virIdentityGetSystem();
>+    VIR_LOCK_GUARD lock = virLockGuardLock(&priv->lock);
>+
>     virIdentitySetCurrent(sysident);
>
>     DEREG_CB(priv->conn, priv->domainEventCallbacks,
>-- 
>2.34.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20230307/92131909/attachment.sig>


More information about the libvir-list mailing list