libvirt/src/remote
Michal Privoznik 5e9bdccd92 remote_daemon_stream: Hold an extra reference to stream in daemonStreamFilter
In v5.9.0-273-g8ecab214de I've tried to fix a lock ordering
problem, but introduced a crasher. Problem is that because the
client lock is unlocked (in order to honour lock ordering) the
stream we are currently checking in daemonStreamFilter() might be
freed and thus stream->priv might not even exist when the control
get to virMutexLock() call.

To resolve this, grab an extra reference to the stream and handle
its cleanup should the refcounter reach zero after the deref.
If that's the case and we are the only ones holding a reference
to the stream, we MUST return a positive value to make
virNetServerClientDispatchRead() break its loop where it iterates
over filters. The problem is, if we did not do so, then
"filter = filter->next" line will read from a memory that was
just freed (freeing a stream also unregisters its filter).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-29 15:00:15 +01:00
..
libvirtd-admin.socket.in systemd: honour $runstatedir in socket unit files 2019-08-27 10:23:05 +01:00
libvirtd-ro.socket.in systemd: honour $runstatedir in socket unit files 2019-08-27 10:23:05 +01:00
libvirtd-tcp.socket.in remote: conditionalize systemd socket unit files 2019-08-09 14:06:31 +01:00
libvirtd-tls.socket.in remote: conditionalize systemd socket unit files 2019-08-09 14:06:31 +01:00
libvirtd.aug.in build: don't hardcode /etc in the config related files 2019-08-09 14:06:31 +01:00
libvirtd.conf.in util: drop support for stack traces with logging 2019-10-18 16:25:17 +01:00
libvirtd.libxl.logrotate.in logging: ensure virtlogd rollover takes priority over logrotate 2019-07-12 12:44:59 +01:00
libvirtd.logrotate.in
libvirtd.lxc.logrotate.in logging: ensure virtlogd rollover takes priority over logrotate 2019-07-12 12:44:59 +01:00
libvirtd.pod remote: forbid the --listen arg when systemd socket activation 2019-08-27 10:46:37 +01:00
libvirtd.policy
libvirtd.qemu.logrotate.in logging: ensure virtlogd rollover takes priority over logrotate 2019-07-12 12:44:59 +01:00
libvirtd.rules
libvirtd.sasl
libvirtd.service.in remote: move timeout arg into sysconf file 2019-08-27 10:30:23 +01:00
libvirtd.socket.in systemd: honour $runstatedir in socket unit files 2019-08-27 10:23:05 +01:00
libvirtd.sysconf remote: move timeout arg into sysconf file 2019-08-27 10:30:23 +01:00
libvirtd.sysctl
lxc_protocol.x Remove all Author(s): lines from source file headers 2018-12-13 16:08:38 +00:00
Makefile.inc.am make check-driverimpls work again 2019-11-12 15:00:01 +01:00
qemu_protocol.x Remove all Author(s): lines from source file headers 2018-12-13 16:08:38 +00:00
remote_daemon_config.c remote: Use g_strdup_printf() instead of virAsprintf() 2019-11-12 16:15:58 +01:00
remote_daemon_config.h remote: conditionalize IP socket usage in libvirtd daemon 2019-08-09 14:06:31 +01:00
remote_daemon_dispatch.c remote: Use g_strdup_printf() instead of virAsprintf() 2019-11-12 16:15:58 +01:00
remote_daemon_dispatch.h src/remote: use #pragma once in headers 2019-06-19 17:12:30 +02:00
remote_daemon_stream.c remote_daemon_stream: Hold an extra reference to stream in daemonStreamFilter 2019-11-29 15:00:15 +01:00
remote_daemon_stream.h src/remote: use #pragma once in headers 2019-06-19 17:12:30 +02:00
remote_daemon.c remote: remove unneeded cleanup labels 2019-11-12 17:54:01 +01:00
remote_daemon.h remote: open secondary drivers via remote driver if needed 2019-08-09 14:06:31 +01:00
remote_driver.c Add API to change qemu agent response timeout 2019-11-14 19:10:01 +01:00
remote_driver.h remote: enable connecting to the per-driver daemons 2019-08-09 14:06:31 +01:00
remote_protocol.x Add API to change qemu agent response timeout 2019-11-14 19:10:01 +01:00
test_libvirtd.aug.in systemd: honour $runstatedir in socket unit files 2019-08-27 10:23:05 +01:00
virt-guest-shutdown.target.in
virtproxyd.service.in remote: introduce virtproxyd daemon to handle IP connectivity 2019-08-09 14:06:31 +01:00