1. 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
  2. 27 4月, 2020 1 次提交
  3. 20 3月, 2020 1 次提交
  4. 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
  5. 25 2月, 2020 1 次提交
  6. 29 1月, 2020 3 次提交
  7. 07 1月, 2020 1 次提交
  8. 03 1月, 2020 1 次提交
  9. 17 12月, 2019 1 次提交
  10. 15 11月, 2019 1 次提交
  11. 12 11月, 2019 1 次提交
  12. 21 10月, 2019 1 次提交
  13. 15 10月, 2019 2 次提交
  14. 14 10月, 2019 1 次提交
  15. 12 10月, 2019 5 次提交
  16. 11 10月, 2019 3 次提交
  17. 22 8月, 2019 1 次提交
    • M
      security: Don't increase XATTRs refcounter on failure · 6a2806fd
      Michal Privoznik 提交于
      If user has two domains, each have the same disk (configured for
      RW) but each runs with different seclabel then we deny start of
      the second domain because in order to do that we would need to
      relabel the disk but that would cut the first domain off. Even if
      we did not do that, qemu would fail to start because it would be
      unable to lock the disk image for the second time. So far, this
      behaviour is expected. But what is not expected is that we
      increase the refcounter in XATTRs and leave it like that.
      
      What happens is that when the second domain starts,
      virSecuritySetRememberedLabel() is called, and since there are
      XATTRs from the first domain it increments the refcounter and
      returns it (refcounter == 2 at this point). Then callers
      (virSecurityDACSetOwnership() and
      virSecuritySELinuxSetFileconHelper()) realize that refcounter is
      greater than 1 and desired seclabel doesn't match the one the
      disk image already has and an error is produced. But the
      refcounter is never decremented.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1740024Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      6a2806fd
  18. 03 7月, 2019 5 次提交
  19. 16 4月, 2019 1 次提交
  20. 10 4月, 2019 2 次提交
  21. 01 2月, 2019 1 次提交
  22. 31 1月, 2019 1 次提交
  23. 19 12月, 2018 4 次提交