libvirt/src/rpc
Daniel P. Berrange 0302391ee6 Fix race in ref counting when handling RPC jobs
When an incoming RPC message is ready for processing,

  virNetServerClientDispatchRead()

will invoke the 'dispatchFunc' callback. This is set to

  virNetServerDispatchNewMessage

This function puts the message + client in a queue for processing by the thread
pool. The thread pool worker function is

  virNetServerHandleJob

The first thing this does is acquire an extra reference on the 'client'.

Unfortunately, between the time the message+client are put on the thread pool
queue, and the time the worker runs, the client object may have had its last
reference removed.

We clearly need to add the reference to the client object before putting the
client on the processing queue

* src/rpc/virnetserverclient.c: Add a reference to the client when
  invoking the dispatch function
* src/rpc/virnetserver.c: Don't acquire a reference to the client
  when in the worker thread
2011-07-26 16:22:32 +01:00
..
gendispatch.pl Add virDomainBlockPull support to the remote driver 2011-07-22 13:31:16 +08:00
genprotocol.pl rpc: Fix typos in rpc generator scripts 2011-07-17 12:41:39 +08:00
virnetclient.c remote/ssh: optional "keyfile" parameter. 2011-07-22 07:49:49 -06:00
virnetclient.h remote/ssh: optional "keyfile" parameter. 2011-07-22 07:49:49 -06:00
virnetclientprogram.c Fix leak of 'msg' object in client stream code 2011-07-08 16:19:57 +01:00
virnetclientprogram.h Introduce generic RPC client objects 2011-06-24 11:48:45 +01:00
virnetclientstream.c Fix leak of 'msg' object in client stream code 2011-07-08 16:19:57 +01:00
virnetclientstream.h Introduce generic RPC client objects 2011-06-24 11:48:45 +01:00
virnetmessage.c Improve two log messages in virNetMessage 2011-06-29 11:08:59 +01:00
virnetmessage.h Ensure empty payload is written upon stream completion 2011-06-29 11:08:59 +01:00
virnetprotocol.x Defines the basics of a generic RPC protocol in XDR 2011-06-24 11:48:10 +01:00
virnetsaslcontext.c Add mutex protection to SASL and TLS modules 2011-07-26 08:21:32 +08:00
virnetsaslcontext.h Generic module for handling SASL authentication & encryption 2011-06-24 11:48:25 +01:00
virnetserver.c Fix race in ref counting when handling RPC jobs 2011-07-26 16:22:32 +01:00
virnetserver.h Fix build when using polkit0 2011-07-12 08:44:55 -06:00
virnetserverclient.c Fix race in ref counting when handling RPC jobs 2011-07-26 16:22:32 +01:00
virnetserverclient.h Fix sending of reply to final RPC message 2011-07-08 16:19:57 +01:00
virnetservermdns.c Fix memory leaks in MDNS code 2011-07-26 08:09:18 +08:00
virnetservermdns.h Introduce generic RPC module for advertising via MDNS 2011-06-24 11:48:41 +01:00
virnetserverprogram.c Send back an error if we get unexpected stream control message 2011-06-30 18:04:02 +01:00
virnetserverprogram.h Remove unused virNetServerProgramErrorHander typedef 2011-07-13 11:47:01 +01:00
virnetserverservice.c Use a virFreeCallback on virNetSocket to ensure safe release 2011-07-19 11:20:27 -04:00
virnetserverservice.h Fix hardcoded limit on client requests in RPC code 2011-06-30 18:04:01 +01:00
virnetsocket.c Report error if unable to bind to any socket 2011-07-26 08:14:02 +08:00
virnetsocket.h remote/ssh: optional "keyfile" parameter. 2011-07-22 07:49:49 -06:00
virnettlscontext.c Fix build with gnutls 1.0.x branch 2011-07-26 14:51:03 +01:00
virnettlscontext.h Allow certificate sanity checking to be disabled 2011-07-22 15:18:32 +01:00