libvirt/src/rpc
Jiri Denemark 173c291473 Don't crash if a connection closes early
https://bugzilla.redhat.com/show_bug.cgi?id=1047577

When a client closes its connection to libvirtd early during
virConnectOpen, more specifically just after making
REMOTE_PROC_CONNECT_SUPPORTS_FEATURE call to check if
VIR_DRV_FEATURE_PROGRAM_KEEPALIVE is supported without even waiting for
the result, libvirtd may crash due to a race in keep-alive
initialization. Once receiving the REMOTE_PROC_CONNECT_SUPPORTS_FEATURE
call, the daemon's event loop delegates it to a worker thread. In case
the event loop detects EOF on the connection and calls
virNetServerClientClose before the worker thread starts to handle
REMOTE_PROC_CONNECT_SUPPORTS_FEATURE call, client->keepalive will be
disposed by the time virNetServerClientStartKeepAlive gets called from
remoteDispatchConnectSupportsFeature. Because the flow is common for
both authenticated and read-only connections, even unprivileged clients
may cause the daemon to crash.

To avoid the crash, virNetServerClientStartKeepAlive needs to check if
the connection is still open before starting keep-alive protocol.

Every libvirt release since 0.9.8 is affected by this bug.
2014-01-13 11:09:59 +01:00
..
gendispatch.pl
genprotocol.pl
gensystemtap.pl
virkeepalive.c
virkeepalive.h
virkeepaliveprotocol.x
virnetclient.c
virnetclient.h
virnetclientprogram.c
virnetclientprogram.h
virnetclientstream.c
virnetclientstream.h
virnetmessage.c MacOS: Handle changes to xdrproc_t definition 2013-11-03 09:34:10 -06:00
virnetmessage.h
virnetprotocol.x Adjust legacy max payload size to account for header information 2013-10-07 13:28:44 +02:00
virnetsaslcontext.c Fix invalid read in virNetSASLSessionClientStep debug log 2013-11-26 11:52:58 +01:00
virnetsaslcontext.h Tie SASL callbacks lifecycle to virNetSessionSASLContext 2013-11-26 11:52:58 +01:00
virnetserver.c Get rid of shadowed booleans 2013-10-22 15:50:47 +01:00
virnetserver.h
virnetserverclient.c Don't crash if a connection closes early 2014-01-13 11:09:59 +01:00
virnetserverclient.h
virnetservermdns.c
virnetservermdns.h
virnetserverprogram.c
virnetserverprogram.h
virnetserverservice.c
virnetserverservice.h
virnetsocket.c virnetsocket: fix getsockopt on FreeBSD 2013-11-03 17:08:55 -06:00
virnetsocket.h
virnetsshsession.c
virnetsshsession.h
virnettlscontext.c Remove all direct use of getenv 2013-10-21 14:03:52 +01:00
virnettlscontext.h