1. 13 9月, 2017 2 次提交
  2. 21 8月, 2017 1 次提交
    • J
      Don't autogenerate seclabels of type 'none' · 0f1993aa
      Jim Fehlig 提交于
      When security drivers are active but confinement is not enabled,
      there is no need to autogenerate <seclabel> elements when starting
      a domain def that contains no <seclabel> elements. In fact,
      autogenerating the elements can result in needless save/restore and
      migration failures when the security driver is not active on the
      restore/migration target.
      
      This patch changes the virSecurityManagerGenLabel function in
      src/security_manager.c to only autogenerate a <seclabel> element
      if none is already defined for the domain *and* default
      confinement is enabled. Otherwise the needless <seclabel>
      autogeneration is skipped.
      
      Resolves: https://bugzilla.opensuse.org/show_bug.cgi?id=1051017
      0f1993aa
  3. 17 8月, 2017 2 次提交
    • C
      virt-aa-helper: locking loader/nvram for qemu 2.10 · 03fb4e3d
      Christian Ehrhardt 提交于
      Testing qemu-2.10-rc3 shows issues like:
        qemu-system-aarch64: -drive file=/home/ubuntu/vm-start-stop/vms/
        7936-0_CODE.fd,if=pflash,format=raw,unit=1: Failed to unlock byte 100
      
      There is an apparmor deny due to qemu now locking those files:
       apparmor="DENIED" operation="file_lock" [...]
       name="/home/ubuntu/vm-start-stop/vms/7936-0_CODE.fd"
       name="/var/lib/uvtool/libvirt/images/kvmguest-artful-normal.qcow"
       [...] comm="qemu-system-aarch64" requested_mask="k" denied_mask="k"
      
      The profile needs to allow locking for loader and nvram files via
      the locking (k) rule.
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      03fb4e3d
    • C
      virt-aa-helper: locking disk files for qemu 2.10 · 580cdaa7
      Christian Ehrhardt 提交于
      Testing qemu-2.10-rc2 shows issues like:
        qemu-system-x86_64: -drive file=/var/lib/uvtool/libvirt/images/kvmguest- \
        artful-normal.qcow,format=qcow2,if=none,id=drive-virtio-disk0:
        Failed to lock byte 100
      
      It seems the following qemu commit changed the needs for the backing
      image rules:
      
      (qemu) commit 244a5668106297378391b768e7288eb157616f64
      Author: Fam Zheng <famz@redhat.com>
          file-posix: Add image locking to perm operations
      
      The block appears as:
       apparmor="DENIED" operation="file_lock" [...]
       name="/var/lib/uvtool/libvirt/images/kvmguest-artful-normal.qcow"
       [...] comm="qemu-system-x86" requested_mask="k" denied_mask="k"
      
      With that qemu change in place the rules generated for the image
      and backing files need the allowance to also lock (k) the files.
      
      Disks are added via add_file_path and with this fix rules now get
      that permission, but no other rules are changed, example:
        -  "/var/lib/uvtool/libvirt/images/kvmguest-artful-normal-a2.qcow" rw,
        +  "/var/lib/uvtool/libvirt/images/kvmguest-artful-normal-a2.qcow" rwk
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      580cdaa7
  4. 14 8月, 2017 1 次提交
  5. 27 7月, 2017 1 次提交
  6. 19 7月, 2017 1 次提交
  7. 11 7月, 2017 1 次提交
  8. 22 6月, 2017 1 次提交
    • M
      security: Don't skip relabel for all chardevs · e0d1a378
      Michal Privoznik 提交于
      Our commit e13e8808 was way too generic. Currently, virtlogd is
      used only for chardevs type of file and nothing else. True, we
      must not relabel the path in this case, but we have to in all
      other cases. For instance, if you want to have a physical console
      attached to your guest:
      
          <console type='dev'>
            <source path='/dev/ttyS0'/>
            <target type='virtio' port='1'/>
          </console>
      
      Starting such domain fails because qemu doesn't have access to
      /dev/ttyS0 because we haven't relabelled the path.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      e0d1a378
  9. 16 6月, 2017 4 次提交
  10. 07 6月, 2017 1 次提交
  11. 05 6月, 2017 1 次提交
  12. 24 5月, 2017 1 次提交
  13. 18 5月, 2017 1 次提交
  14. 27 4月, 2017 1 次提交
  15. 27 3月, 2017 2 次提交
    • E
      security: Enable labeling of vfio mediated devices · 606afafb
      Erik Skultety 提交于
      This patch updates all of our security driver to start labeling the
      VFIO IOMMU devices under /dev/vfio/ as well.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      606afafb
    • E
      conf: Introduce new hostdev device type mdev · ec783d7c
      Erik Skultety 提交于
      A mediated device will be identified by a UUID (with 'model' now being
      a mandatory <hostdev> attribute to represent the mediated device API) of
      the user pre-created mediated device. We also need to make sure that if
      user explicitly provides a guest address for a mdev device, the address
      type will be matching the device API supported on that specific mediated
      device and error out with an incorrect XML message.
      
      The resulting device XML:
      <devices>
        <hostdev mode='subsystem' type='mdev' model='vfio-pci'>
          <source>
            <address uuid='c2177883-f1bb-47f0-914d-32a22e3a8804'>
          </source>
        </hostdev>
      </devices>
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      ec783d7c
  16. 15 3月, 2017 4 次提交
  17. 15 2月, 2017 2 次提交
    • J
      apparmor: don't fail on non-apparmor <seclabel> · ec94e14b
      Jim Fehlig 提交于
      If the apparmor security driver is loaded/enabled and domain config
      contains a <seclabel> element whose type attribute is not 'apparmor',
      starting the domain fails when attempting to label resources such
      as tap FDs.
      
      Many of the apparmor driver entry points attempt to retrieve the
      apparmor security label from the domain def, returning failure if
      not found. Functions such as AppArmorSetFDLabel fail even though
      domain config contains an explicit 'none' secuirty driver, e.g.
      
        <seclabel type='none' model='none'/>
      
      Change the entry points to succeed if the domain config <seclabel>
      is not apparmor. This matches the behavior of the selinux driver.
      ec94e14b
    • J
      apparmor: don't overwrite error from reload_profile · 5cdfc80b
      Jim Fehlig 提交于
      Like other callers of reload_profile, don't overwrite errors in
      AppArmorSetSecurityHostdevLabelHelper.
      5cdfc80b
  18. 17 1月, 2017 2 次提交
  19. 11 1月, 2017 1 次提交
  20. 10 1月, 2017 4 次提交
  21. 09 1月, 2017 1 次提交
  22. 08 12月, 2016 1 次提交
  23. 30 11月, 2016 1 次提交
    • C
      virt-aa-helper: fix parsing security labels by introducing VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL · dffdac06
      Christian Ehrhardt 提交于
      When virt-aa-helper parses xml content it can fail on security labels.
      
      It fails by requiring to parse active domain content on seclabels that
      are not yet filled in.
      
      Testcase with virt-aa-helper on a minimal xml:
       $ cat << EOF > /tmp/test.xml
      <domain type='kvm'>
          <name>test-seclabel</name>
          <uuid>12345678-9abc-def1-2345-6789abcdef00</uuid>
          <memory unit='KiB'>1</memory>
          <os><type arch='x86_64'>hvm</type></os>
          <seclabel type='dynamic' model='apparmor' relabel='yes'/>
          <seclabel type='dynamic' model='dac' relabel='yes'/>
      </domain>
      EOF
       $ /usr/lib/libvirt/virt-aa-helper -d -r -p 0 \
         -u libvirt-12345678-9abc-def1-2345-6789abcdef00 < /tmp/test.xml
      
      Current Result:
       virt-aa-helper: error: could not parse XML
       virt-aa-helper: error: could not get VM definition
      Expected Result is a valid apparmor profile
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      Signed-off-by: NGuido Günther <agx@sigxcpu.org>
      dffdac06
  24. 25 11月, 2016 2 次提交
  25. 12 11月, 2016 1 次提交