1. 27 9月, 2013 1 次提交
    • D
      Fix crash in libvirtd when events are registered & ACLs active · 966025b1
      Daniel P. Berrange 提交于
      When a client disconnects from libvirtd, all event callbacks
      must be removed. This involves running the public API
      
        virConnectDomainEventDeregisterAny
      
      This code does not run in normal API dispatch context, so no
      identity was set. The result was that the access control drivers
      denied the attempt to deregister callbacks. The callbacks thus
      continued to trigger after the client was free'd causing fairly
      predictable use of free memory & a crash.
      
      This can be triggered by any client with readonly access when
      the ACL drivers are active.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 8294aa0c)
      966025b1
  2. 19 9月, 2013 1 次提交
    • D
      Fix crash in remoteDispatchDomainMemoryStats (CVE-2013-4296) · f229972f
      Daniel P. Berrange 提交于
      The 'stats' variable was not initialized to NULL, so if some
      early validation of the RPC call fails, it is possible to jump
      to the 'cleanup' label and VIR_FREE an uninitialized pointer.
      This is a security flaw, since the API can be called from a
      readonly connection which can trigger the validation checks.
      
      This was introduced in release v0.9.1 onwards by
      
        commit 158ba873
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Wed Apr 13 16:21:35 2011 +0100
      
          Merge all returns paths from dispatcher into single path
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit e7f400a1)
      f229972f
  3. 18 9月, 2013 1 次提交
    • D
      Add support for using 3-arg pkcheck syntax for process (CVE-2013-4311) · 003b655e
      Daniel P. Berrange 提交于
      With the existing pkcheck (pid, start time) tuple for identifying
      the process, there is a race condition, where a process can make
      a libvirt RPC call and in another thread exec a setuid application,
      causing it to change to effective UID 0. This in turn causes polkit
      to do its permission check based on the wrong UID.
      
      To address this, libvirt must get the UID the caller had at time
      of connect() (from SO_PEERCRED) and pass a (pid, start time, uid)
      triple to the pkcheck program.
      
      This fix requires that libvirt is re-built against a version of
      polkit that has the fix for its CVE-2013-4288, so that libvirt
      can see 'pkg-config --variable pkcheck_supports_uid polkit-gobject-1'
      Signed-off-by: NColin Walters <walters@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 922b7fda)
      003b655e
  4. 29 8月, 2013 1 次提交
  5. 18 7月, 2013 2 次提交
  6. 10 7月, 2013 2 次提交
  7. 25 6月, 2013 1 次提交
  8. 31 5月, 2013 1 次提交
    • E
      build: cast [ug]id_t when printing · f43bb1dc
      Eric Blake 提交于
      This is a recurring problem for cygwin :)
      For example, see commit 23a4df88.
      
      qemu/qemu_driver.c: In function 'qemuStateInitialize':
      qemu/qemu_driver.c:691:13: error: format '%d' expects type 'int', but argument 8 has type 'uid_t' [-Wformat]
      
      * src/qemu/qemu_driver.c (qemuStateInitialize): Add casts.
      * daemon/remote.c (remoteDispatchAuthList): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f43bb1dc
  9. 21 5月, 2013 1 次提交
  10. 16 5月, 2013 1 次提交
    • J
      daemon: fix leak after listing all volumes · ca697e90
      Ján Tomko 提交于
      CVE-2013-1962
      
      remoteDispatchStoragePoolListAllVolumes wasn't freeing the pool.
      The pool also held a reference to the connection, preventing it from
      getting freed and closing the netcf interface driver, which held two
      sockets open.
      ca697e90
  11. 09 5月, 2013 1 次提交
  12. 08 5月, 2013 1 次提交
  13. 05 5月, 2013 1 次提交
  14. 03 5月, 2013 1 次提交
  15. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  16. 24 4月, 2013 2 次提交
  17. 18 4月, 2013 1 次提交
  18. 13 3月, 2013 1 次提交
    • D
      Remove hack using existance of an 'identity' string to disable auth · be27de6e
      Daniel P. Berrange 提交于
      Currently the server determines whether authentication of clients
      is complete, by checking whether an identity is set. This patch
      removes that lame hack and replaces it with an explicit method
      for changing the client auth code
      
      * daemon/remote.c: Update for new APis
      * src/libvirt_private.syms, src/rpc/virnetserverclient.c,
        src/rpc/virnetserverclient.h: Remove virNetServerClientGetIdentity
        and virNetServerClientSetIdentity, adding a new method
        virNetServerClientSetAuth.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      be27de6e
  19. 23 2月, 2013 1 次提交
  20. 18 1月, 2013 1 次提交
  21. 16 1月, 2013 1 次提交
  22. 14 1月, 2013 3 次提交
    • D
      Introduce an LXC specific public API & library · 3d1596b0
      Daniel P. Berrange 提交于
      This patch introduces support for LXC specific public APIs. In
      common with what was done for QEMU, this creates a libvirt_lxc.so
      library and libvirt/libvirt-lxc.h header file.
      
      The actual APIs are
      
        int virDomainLxcOpenNamespace(virDomainPtr domain,
                                      int **fdlist,
                                      unsigned int flags);
      
        int virDomainLxcEnterNamespace(virDomainPtr domain,
                                       unsigned int nfdlist,
                                       int *fdlist,
                                       unsigned int *noldfdlist,
                                       int **oldfdlist,
                                       unsigned int flags);
      
      which provide a way to use the setns() system call to move the
      calling process into the container's namespace. It is not
      practical to write in a generically applicable manner. The
      nearest that we could get to such an API would be an API which
      allows to pass a command + argv to be executed inside a
      container. Even if we had such a generic API, this LXC specific
      API is still useful, because it allows the caller to maintain
      the current process context, in particular any I/O streams they
      have open.
      
      NB the virDomainLxcEnterNamespace() API is special in that it
      runs client side, so does not involve the internal driver API.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3d1596b0
    • D
      Rename HAVE_POLKIT to WITH_POLKIT · cf7ac00e
      Daniel P. Berrange 提交于
      cf7ac00e
    • D
      Rename HAVE_GNUTLS to WITH_GNUTLS · bccd4a8c
      Daniel P. Berrange 提交于
      bccd4a8c
  23. 11 1月, 2013 1 次提交
  24. 09 1月, 2013 1 次提交
  25. 21 12月, 2012 6 次提交
  26. 18 12月, 2012 1 次提交
  27. 26 11月, 2012 1 次提交
    • A
      Add private data pointer to virStoragePool and virStorageVol · 2b121dbc
      Ata E Husain Bohra 提交于
      This will simplify the refactoring of the ESX storage driver to support
      a VMFS and an iSCSI backend.
      
      One of the tasks the storage driver needs to do is to decide which backend
      driver needs to be invoked for a given request. This approach extends
      virStoragePool and virStorageVol to store extra parameters:
      
      1. privateData: stores pointer to respective backend storage driver.
      2. privateDataFreeFunc: stores cleanup function pointer.
      
      virGetStoragePool and virGetStorageVol are modfied to accept these extra
      parameters as user params. virStoragePoolDispose and virStorageVolDispose
      checks for cleanup operation if available.
      
      The private data pointer allows the ESX storage driver to store a pointer
      to the used backend with each storage pool and volume. This avoids the need
      to detect the correct backend in each storage driver function call.
      2b121dbc
  28. 02 11月, 2012 1 次提交
    • E
      cpumap: optimize for clients that don't need online count · 3d0130cb
      Eric Blake 提交于
      It turns out that calling virNodeGetCPUMap(conn, NULL, NULL, 0)
      is both useful, and with Viktor's patches, common enough to
      optimize.  Since this interface hasn't been released yet, we
      can change the RPC call.
      
      A bit more background on the optimization - learning the cpu count
      is a single file read (/sys/devices/system/cpu/possible), but
      learning the number of online cpus can possibly trigger a file
      read per cpu, depending on the age of the kernel, and all wasted
      if the caller passed NULL for both arguments.
      
      * src/nodeinfo.c (nodeGetCPUMap): Avoid bitmap when not needed.
      * src/remote/remote_protocol.x (remote_node_get_cpu_map_args):
      Supply two separate flags for needed arguments.
      * src/remote/remote_driver.c (remoteNodeGetCPUMap): Update
      caller.
      * daemon/remote.c (remoteDispatchNodeGetCPUMap): Likewise.
      * src/remote_protocol-structs: Regenerate.
      3d0130cb
  29. 24 10月, 2012 1 次提交
  30. 15 10月, 2012 1 次提交
    • M
      Add support for SUSPEND_DISK event · 7ba5defb
      Martin Kletzander 提交于
      This patch adds support for SUSPEND_DISK event; both lifecycle and
      separated.  The support is added for QEMU, machines are changed to
      PMSUSPENDED, but as QEMU sends SHUTDOWN afterwards, the state changes
      to shut-off.  This and much more needs to be done in order for libvirt
      to work with transient devices, wake-ups etc.  This patch is not
      aiming for that functionality.
      7ba5defb