1. 22 5月, 2015 1 次提交
    • T
      conf: fix issue on virCPUDefCopy · f0be92b4
      Thibaut Collet 提交于
      The cpu xml copy is incorrect: the memAccess field is not copied.
      The lack of copy of this memAccess field can cause unexpected behaviour for live
      migration when vhost user is used.
      
      For example if guest has the following configuration:
      ....
      <cpu>
      <model>Westmere</model>
      <topology sockets="1" cores="4" threads="1"/>
      <numa>
      <cell id='0' cpus='0-3' memory='2097152' memAccess='shared'/>
      </numa>
      </cpu>
      ....
      
      The used configuration on the remote host in case of live migration is:
      ....
        <cpu mode='custom' match='exact'>
          <model fallback='allow'>Westmere</model>
          <topology sockets='1' cores='4' threads='1'/>
          <numa>
            <cell id='0' cpus='0-3' memory='2097152' unit='KiB'/>
          </numa>
        </cpu>
      ....
      
      On the remote host the lack of memAccess info can cause unexpected error on the
      qemu backend vhost user driver.
      
      Fixes: def6b359 ("docs, conf, schema: add support for shared memory mapping")
      
      This issue is present only for libvirt1.2.9 to libvirt1.2.12
      With patch 181742d4 ("conf: Move all NUMA configuration to virDomainNuma")
      present since libvirt1.2.13 the problem does not exist anymore as NUMA
      information are no more in the CPU configuration.
      Signed-off-by: NThibaut Collet <thibaut.collet@6wind.com>
      f0be92b4
  2. 17 3月, 2015 1 次提交
    • E
      daemon: avoid memleak when ListAll returns nothing · b175298b
      Eric Blake 提交于
      Commit 4f25146b (v1.2.8) managed to silence Coverity, but at the
      cost of a memory leak detected by valgrind:
      ==24129== 40 bytes in 5 blocks are definitely lost in loss record 355 of 637
      ==24129==    at 0x4A08B1C: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==24129==    by 0x5084B8E: virReallocN (viralloc.c:245)
      ==24129==    by 0x514D5AA: virDomainObjListExport (domain_conf.c:22200)
      ==24129==    by 0x201227DB: qemuConnectListAllDomains (qemu_driver.c:18042)
      ==24129==    by 0x51CC1B6: virConnectListAllDomains (libvirt-domain.c:6797)
      ==24129==    by 0x14173D: remoteDispatchConnectListAllDomains (remote.c:1580)
      ==24129==    by 0x121BE1: remoteDispatchConnectListAllDomainsHelper (remote_dispatch.h:1072)
      
      In short, every time a client calls a ListAll variant and asks
      for the resulting list, but there are 0 elements to return, we
      end up leaking the 1-entry array that holds the NULL terminator.
      
      What's worse, a read-only client can access these functions in a
      tight loop to cause libvirtd to eventually run out of memory; and
      this can be considered a denial of service attack against more
      privileged clients.  Thankfully, the leak is so small (8 bytes per
      call) that you would already have some other denial of service with
      any guest calling the API that frequently, so an out-of-memory
      crash is unlikely enough that this did not warrant a CVE.
      
      * daemon/remote.c (remoteDispatchConnectListAllDomains)
      (remoteDispatchDomainListAllSnapshots)
      (remoteDispatchDomainSnapshotListAllChildren)
      (remoteDispatchConnectListAllStoragePools)
      (remoteDispatchStoragePoolListAllVolumes)
      (remoteDispatchConnectListAllNetworks)
      (remoteDispatchConnectListAllInterfaces)
      (remoteDispatchConnectListAllNodeDevices)
      (remoteDispatchConnectListAllNWFilters)
      (remoteDispatchConnectListAllSecrets)
      (remoteDispatchNetworkGetDHCPLeases): Plug leak.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      (cherry picked from commit 3c2ff502)
      b175298b
  3. 23 1月, 2015 2 次提交
  4. 13 12月, 2014 2 次提交
  5. 12 12月, 2014 1 次提交
  6. 11 12月, 2014 6 次提交
  7. 10 12月, 2014 25 次提交
  8. 09 12月, 2014 2 次提交
    • J
      security: Manage SELinux labels on shared/readonly hostdev's · f36d9285
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1082521
      
      Support for shared hostdev's was added in a number of commits, initially
      starting with 'f2c1d9a8' and most recently commit id 'fd243fc4' to fix
      issues with the initial implementation.  Missed in all those changes was
      the need to mimic the virSELinux{Set|Restore}SecurityDiskLabel code to
      handle the "shared" (or shareable) and readonly options when Setting
      or Restoring the SELinux labels.
      
      This patch will adjust the virSecuritySELinuxSetSecuritySCSILabel to not
      use the virSecuritySELinuxSetSecurityHostdevLabelHelper in order to set
      the label. Rather follow what the Disk code does by setting the label
      differently based on whether shareable/readonly is set.  This patch will
      also modify the virSecuritySELinuxRestoreSecuritySCSILabel to follow
      the same logic as virSecuritySELinuxRestoreSecurityImageLabelInt and not
      restore the label if shared/readonly
      f36d9285
    • J
      tests: Fix sharable typo · 048237e3
      John Ferlan 提交于
      048237e3