[libvirt] [PATCH] qemu: monitor: fix unsafe monitor access

Peter Krempa pkrempa at redhat.com
Wed Feb 28 09:43:27 UTC 2018


On Thu, Mar 01, 2018 at 01:09:40 +0800, Peng Hao wrote:
> From: root <root at localhost.localdomain>
> 
> qemuDomainObjExitMonitor is unsafe
> 
> domain lock released when qemuDomainObjEnterMonitor finish,
> So other thread (qemuProcessStop) has chance to modify priv->mon
> to NULL. qemuDomainObjExitMonitor will never release the mon->lock,
> 
> that may cause problem:
> thread get monitor ptr early, and then try to get mon->lock,
> it will block forerver cause mon->lock not released by
> qemuDomainObjExitMonitor.

Could you please provide a reproducer for this? The call to
qemuProcessStop should be guarded by a domain job, which should
guarantee that priv->mon is unset only after the currently processed
monitor call exits properly.
-------------- 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/20180228/b0342d17/attachment-0001.sig>


More information about the libvir-list mailing list