1. 06 6月, 2018 1 次提交
    • S
      security: Label the external swtpm with SELinux labels · 2fc665bb
      Stefan Berger 提交于
      In this patch we label the swtpm process with SELinux labels. We give it the
      same label as the QEMU process has. We label its state directory and files
      as well. We restore the old security labels once the swtpm has terminated.
      
      The file and process labels now look as follows:
      
      Directory: /var/lib/libvirt/swtpm
      
      [root@localhost swtpm]# ls -lZ
      total 4
      rwx------. 2 tss  tss  system_u:object_r:svirt_image_t:s0:c254,c932 4096 Apr  5 16:46 testvm
      
      [root@localhost testvm]# ls -lZ
      total 8
      -rw-r--r--. 1 tss tss system_u:object_r:svirt_image_t:s0:c254,c932 3648 Apr  5 16:46 tpm-00.permall
      
      The log in /var/log/swtpm/libvirt/qemu is labeled as follows:
      
      -rw-r--r--. 1 tss tss system_u:object_r:svirt_image_t:s0:c254,c932 2237 Apr  5 16:46 vtpm.log
      
      [root@localhost 485d0004-a48f-436a-8457-8a3b73e28567]# ps auxZ | grep swtpm | grep ctrl | grep -v grep
      system_u:system_r:svirt_t:s0:c254,c932 tss 25664 0.0  0.0 28172  3892 ?        Ss   16:57   0:00 /usr/bin/swtpm socket --daemon --ctrl type=unixio,path=/var/run/libvirt/qemu/swtpm/testvm-swtpm.sock,mode=0660 --tpmstate dir=/var/lib/libvirt/swtpm/testvm/tpm1.2 --log file=/var/log/swtpm/libvirt/qemu/testvm-swtpm.log
      
      [root@localhost 485d0004-a48f-436a-8457-8a3b73e28567]# ps auxZ | grep qemu | grep tpm | grep -v grep
      system_u:system_r:svirt_t:s0:c254,c932 qemu 25669 99.0  0.0 3096704 48500 ?    Sl   16:57   3:28 /bin/qemu-system-x86_64 [..]
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      2fc665bb
  2. 05 12月, 2017 1 次提交
  3. 25 11月, 2017 1 次提交
  4. 16 6月, 2017 1 次提交
  5. 15 3月, 2017 1 次提交
    • M
      qemu_hotplug: Relabel memdev · 78612aa5
      Michal Privoznik 提交于
      Now that we have APIs for relabel memdevs on hotplug, fill in the
      missing implementation in qemu hotplug code.
      
      The qemuSecurity wrappers might look like overkill for now,
      because qemu namespace code does not deal with the nvdimms yet.
      Nor does our cgroup code.  But hey, there's cgroup_device_acl
      variable in qemu.conf. If users add their /dev/pmem* device in
      there, the device is allowed in cgroups and created in the
      namespace so they can successfully passthrough it to the domain.
      It doesn't look like overkill after all, does it?
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      78612aa5
  6. 09 2月, 2017 1 次提交
  7. 08 2月, 2017 1 次提交
  8. 07 2月, 2017 2 次提交
  9. 10 1月, 2017 1 次提交
    • M
      qemu: Use transactions from security driver · 095f042e
      Michal Privoznik 提交于
      So far if qemu is spawned under separate mount namespace in order
      to relabel everything it needs an access to the security driver
      to run in that namespace too. This has a very nasty down side -
      it is being run in a separate process, so any internal state
      transition is NOT reflected in the daemon. This can lead to many
      sleepless nights. Therefore, use the transaction APIs so that
      libvirt developers can sleep tight again.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      095f042e
  10. 15 12月, 2016 3 次提交