1. 27 8月, 2019 1 次提交
  2. 22 8月, 2019 5 次提交
  3. 20 8月, 2019 1 次提交
  4. 19 8月, 2019 3 次提交
    • A
      virt-aa-helper: Fix AppArmor profile · b1eb8b3e
      Andrea Bolognani 提交于
      Since
      
        commit 432faf25
        Author: Michal Privoznik <mprivozn@redhat.com>
        Date:   Tue Jul 2 19:49:51 2019 +0200
      
          virCommand: use procfs to learn opened FDs
      
          When spawning a child process, between fork() and exec() we close
          all file descriptors and keep only those the caller wants us to
          pass onto the child. The problem is how we do that. Currently, we
          get the limit of opened files and then iterate through each one
          of them and either close() it or make it survive exec(). This
          approach is suboptimal (although, not that much in default
          configurations where the limit is pretty low - 1024). We have
          /proc where we can learn what FDs we hold open and thus we can
          selectively close only those.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      
        v5.5.0-173-g432faf25
      
      programs using the virCommand APIs on Linux need read access to
      /proc/self/fd, or they will fail like
      
        error : virCommandWait:2796 : internal error: Child process
        (LIBVIRT_LOG_OUTPUTS=3:stderr /usr/lib/libvirt/virt-aa-helper -c
         -u libvirt-b20e9a8e-091a-45e0-8823-537119e98bc6) unexpected exit
        status 1: libvirt:  error : cannot open directory '/proc/self/fd':
        Permission denied
        virt-aa-helper: error: apparmor_parser exited with error
      
      Update the AppArmor profile for virt-aa-helper so that read access
      to the relevant path is granted.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      b1eb8b3e
    • A
      virt-aa-helper: Call virCommandRawStatus() · b194c3d9
      Andrea Bolognani 提交于
      The way we're processing the return status, using WIFEXITED() and
      friends, only works when we have the raw return status; however,
      virCommand defaults to processing the return status for us. Call
      virCommandRawStatus() before virCommandRun() so that we get the raw
      return status and the logic can actually work.
      
      This results in guest startup failures caused by AppArmor issues
      being reported much earlier: for example, if virt-aa-helper exits
      with an error we're now reporting
      
        error: internal error: cannot load AppArmor profile 'libvirt-b20e9a8e-091a-45e0-8823-537119e98bc6'
      
      instead of the misleading
      
        error: internal error: Process exited prior to exec: libvirt:
        error : unable to set AppArmor profile 'libvirt-b20e9a8e-091a-45e0-8823-537119e98bc6'
        for '/usr/bin/qemu-system-x86_64': No such file or directory
      Suggested-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      b194c3d9
    • A
      virt-aa-helper: Use virCommand APIs directly · 7d3a0f56
      Andrea Bolognani 提交于
      Right now we're using the virRun() convenience API, but that
      doesn't allow the kind of control we want. Use the virCommand
      APIs directly instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      7d3a0f56
  5. 07 8月, 2019 1 次提交
  6. 18 7月, 2019 2 次提交
  7. 15 7月, 2019 1 次提交
  8. 03 7月, 2019 11 次提交
  9. 19 6月, 2019 2 次提交
  10. 17 5月, 2019 1 次提交
    • D
      src: don't statically link code that's already in libvirt.so · e5df4ede
      Daniel P. Berrangé 提交于
      Various binaries are statically linking to libvirt_util.la and
      other intermediate libraries we build. These intermediate libs
      all get built into the main libvirt.so shared library eventually,
      so we can dynamically link to that instead and reduce the on disk
      footprint.
      
      In libvirt-daemon RPM:
      
                  virtlockd: 1.6 MB -> 153 KB
                   virtlogd: 1.6 MB -> 157 KB
           libvirt_iohelper: 937 KB -> 23 KB
      
      In libvirt-daemon-driver-network RPM:
      
       libvirt_leaseshelper: 940 KB -> 26 KB
      
      In libvirt-daemon-driver-storage-core RPM:
      
         libvirt_parthelper: 926 KB -> 21 KB
      
      IOW, about 5.6 MB total space saving in a build done on Fedora 30
      x86_64 architecture.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      e5df4ede
  11. 16 5月, 2019 1 次提交
  12. 17 4月, 2019 2 次提交
  13. 16 4月, 2019 1 次提交
  14. 12 4月, 2019 1 次提交
  15. 10 4月, 2019 2 次提交
  16. 03 4月, 2019 1 次提交
    • D
      security: avoid use of dirent d_type field · c1ac1e46
      Daniel P. Berrangé 提交于
      The d_type field cannot be assumed to be filled. Some filesystems, such
      as older XFS, will simply report DT_UNKNOWN.
      
      Even if the d_type is filled in, the use of it in the SELinux functions
      is dubious. If labelling all files in a directory there's no reason to
      skip things which are not regular files. We merely need to skip "." and
      "..", which is done by virDirRead() already.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      c1ac1e46
  17. 01 4月, 2019 1 次提交
  18. 14 3月, 2019 1 次提交
    • J
      apparmor: Check libvirtd profile status by name · 411cdaf8
      Jim Fehlig 提交于
      Commit a3ab6d42 changed the libvirtd profile to a named profile,
      breaking the apparmor driver's ability to detect if the profile is
      active. When the apparmor driver loads it checks the status of the
      libvirtd profile using the full binary path, which fails since the
      profile is now referenced by name. If the apparmor driver is
      explicitly requested in /etc/libvirt/qemu.conf, then libvirtd fails
      to load too.
      
      Instead of only checking the profile status by full binary path,
      also check by profile name. The full path check is retained in case
      users have a customized libvirtd profile with full path.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Acked-by: NJamie Strandboge <jamie@canonical.com>
      411cdaf8
  19. 07 3月, 2019 1 次提交
  20. 06 3月, 2019 1 次提交