1. 23 6月, 2020 1 次提交
  2. 18 6月, 2020 2 次提交
  3. 15 6月, 2020 1 次提交
  4. 10 6月, 2020 1 次提交
  5. 27 5月, 2020 1 次提交
    • C
      security: don't fail if built without attr support · 55029d93
      Christian Ehrhardt 提交于
      If built without attr support removing any image will trigger
       qemuBlockRemoveImageMetadata (the one that emits the warning)
         -> qemuSecurityMoveImageMetadata
           -> virSecurityManagerMoveImageMetadata
             -> virSecurityDACMoveImageMetadata
               -> virSecurityDACMoveImageMetadataHelper
                 -> virProcessRunInFork (spawns subprocess)
                   -> virSecurityMoveRememberedLabel
      
      In there due to !HAVE_LIBATTR virFileGetXAttrQuiet will return
      ENOSYS and from there the chain will error out.
      
      That is wrong and looks like:
        libvirtd[6320]: internal error: child reported (status=125):
        libvirtd[6320]: Unable to remove disk metadata on vm testguest from
        /var/lib/uvtool/libvirt/images/testguest.qcow (disk target vda)
      
      This change makes virSecurityDACMoveImageMetadataHelper and
      virSecuritySELinuxMoveImageMetadataHelper accept that
      error code gracefully and in that sense it is an extension of:
      5214b2f1 "security: Don't skip label restore on file systems lacking XATTRs"
      which does the same for other call chains into the virFile*XAttr functions.
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      55029d93
  6. 18 5月, 2020 1 次提交
  7. 15 5月, 2020 1 次提交
  8. 05 5月, 2020 1 次提交
  9. 27 4月, 2020 1 次提交
  10. 23 4月, 2020 1 次提交
  11. 17 4月, 2020 2 次提交
    • M
      qemu: Label restore path outside of secdriver transactions · 28fdfd20
      Michal Privoznik 提交于
      As explained in the previous commit, we need to relabel the file
      we are restoring the domain from. That is the FD that is passed
      to QEMU. If the file is not under /dev then the file inside the
      namespace is the very same as the one in the host. And regardless
      of using transactions, the file will be relabeled. But, if the
      file is under /dev then when using transactions only the copy
      inside the namespace is relabeled and the one in the host is not.
      But QEMU is reading from the one in the host, actually.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1772838Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      28fdfd20
    • M
      security: Introduce virSecurityManagerDomainSetPathLabelRO · 55cbb94e
      Michal Privoznik 提交于
      This API allows drivers to separate out handling of @stdin_path
      of virSecurityManagerSetAllLabel(). The thing is, the QEMU driver
      uses transactions for virSecurityManagerSetAllLabel() which
      relabels devices from inside of domain's namespace. This is what
      we usually want. Except when resuming domain from a file. The
      file is opened before any namespace is set up and the FD is
      passed to QEMU to read the migration stream from. Because of
      this, the file lives outside of the namespace and if it so
      happens that the file is a block device (i.e. it lives under
      /dev) its copy will be created in the namespace. But the FD that
      is passed to QEMU points to the original living in the host and
      not in the namespace. So relabeling the file inside the namespace
      helps nothing.
      
      But if we have a separate API for relabeling the restore file
      then the QEMU driver can continue calling
      virSecurityManagerSetAllLabel() with transactions enabled and
      call this new API without transactions.
      
      We already have an API for relabeling a single file
      (virSecurityManagerDomainSetPathLabel()) but in case of SELinux
      it uses @imagelabel (which allows RW access) and we want to use
      @content_context (which allows RO access).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      55cbb94e
  12. 15 4月, 2020 1 次提交
  13. 20 3月, 2020 1 次提交
  14. 14 3月, 2020 1 次提交
  15. 09 3月, 2020 1 次提交
    • M
      security: Introduce VIR_SECURITY_DOMAIN_IMAGE_PARENT_CHAIN_TOP flag · 62f3d8ad
      Michal Privoznik 提交于
      Our decision whether to remember seclabel for a disk image
      depends on a few factors. If the image is readonly or shared or
      not the chain top the remembering is suppressed for the image.
      However, the virSecurityManagerSetImageLabel() is too low level
      to determine whether passed @src is chain top or not. Even though
      the function has the @parent argument it does not necessarily
      reflect the chain top - it only points to the top level image in
      the chain we want to relabel and not to the topmost image of the
      whole chain. And this can't be derived from the passed domain
      definition reliably neither - in some cases (like snapshots or
      block copy) the @src is added to the definition only after the
      operation succeeded. Therefore, introduce a flag which callers
      can use to help us with the decision.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
      62f3d8ad
  16. 06 3月, 2020 1 次提交
  17. 25 2月, 2020 4 次提交
  18. 24 2月, 2020 2 次提交
  19. 12 2月, 2020 1 次提交
  20. 07 2月, 2020 1 次提交
  21. 04 2月, 2020 1 次提交
  22. 31 1月, 2020 1 次提交
    • C
      apparmor: fix qemu_bridge_helper for named profile · 5a21fd51
      Christian Ehrhardt 提交于
      Since a3ab6d42 "apparmor: convert libvirtd profile to a named profile"
      the detection of the subelement for qemu_bridge_helper is wrong.
      
      In combination with the older 123cc3e1 "apparmor: allow
      /usr/lib/qemu/qemu-bridge-helper" it now detects qemu-bridge-helper no
      more with its path, but instead as a proper subelement of the named profile
      like: label=libvirtd//qemu_bridge_helper
      
      In the same fashion the reverse rule in the qemu_bridge_helper
      sub-profile still uses the path and not the named profile label.
      
      Triggering denies like:
      apparmor="DENIED" operation="file_inherit"
        profile="libvirtd//qemu_bridge_helper" pid=5629 comm="qemu-bridge-hel"
        family="unix" sock_type="stream" protocol=0 requested_mask="send receive"
        denied_mask="send receive" addr=none peer_addr=none peer="libvirtd"
      
      This patch fixes the unix socket rules for the communication between
      libvirtd and qemu-bridge-helper to match that.
      
      Fixes: a3ab6d42
      Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1655111Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      5a21fd51
  23. 30 1月, 2020 4 次提交
  24. 29 1月, 2020 5 次提交
  25. 07 1月, 2020 3 次提交