1. 24 1月, 2020 2 次提交
  2. 08 1月, 2020 1 次提交
  3. 20 12月, 2019 3 次提交
  4. 12 12月, 2019 1 次提交
    • D
      qemu: keep capabilities when running QEMU as root · 19023562
      Daniel P. Berrangé 提交于
      When QEMU uid/gid is set to non-root this is pointless as if we just
      used a regular setuid/setgid call, the process will have all its
      capabilities cleared anyway by the kernel.
      
      When QEMU uid/gid is set to root, this is almost (always?) never
      what people actually want. People make QEMU run as root in order
      to access some privileged resource that libvirt doesn't support
      yet and this often requires capabilities. As a result they have
      to go find the qemu.conf param to turn this off. This is not
      viable for libguestfs - they want to control everything via the
      XML security label to request running as root regardless of the
      qemu.conf settings for user/group.
      
      Clearing capabilities was implemented originally because there
      was a proposal in Fedora to change permissions such that root,
      with no capabilities would not be able to compromise the system.
      ie a locked down root account. This never went anywhere though,
      and as a result clearing capabilities when running as root does
      not really get us any security benefit AFAICT. The root user
      can easily do something like create a cronjob, which will then
      faithfully be run with full capabilities, trivially bypassing
      the restriction we place.
      
      IOW, our clearing of capabilities is both useless from a security
      POV, and breaks valid use cases when people need to run as root.
      
      This removes the clear_emulator_capabilities configuration
      option from qemu.conf, and always runs QEMU with capabilities
      when root.  The behaviour when non-root is unchanged.
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      19023562
  5. 09 12月, 2019 5 次提交
  6. 22 11月, 2019 1 次提交
    • D
      util: consolidate on one free callback for hash data · bc7e7291
      Daniel P. Berrangé 提交于
      This previous commit introduced a simpler free callback for
      hash data with only 1 arg, the value to free:
      
        commit 49288fac
        Author: Peter Krempa <pkrempa@redhat.com>
        Date:   Wed Oct 9 15:26:37 2019 +0200
      
          util: hash: Add possibility to use simpler data free function in virHash
      
      It missed two functions in the hash table code which need
      to call the alternate data free function, virHashRemoveEntry
      and virHashRemoveSet.
      
      After the previous patch though, there is no code that
      makes functional use of the 2nd key arg in the data
      free function. There is merely one log message that can
      be dropped.
      
      We can thus purge the current virHashDataFree callback
      entirely, and rename virHashDataFreeSimple to replace
      it.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      bc7e7291
  7. 12 11月, 2019 2 次提交
  8. 21 10月, 2019 1 次提交
  9. 18 10月, 2019 1 次提交
  10. 16 10月, 2019 4 次提交
  11. 15 10月, 2019 2 次提交
  12. 19 9月, 2019 1 次提交
  13. 10 9月, 2019 5 次提交
  14. 09 9月, 2019 3 次提交
  15. 06 9月, 2019 2 次提交
  16. 30 8月, 2019 1 次提交
  17. 27 8月, 2019 1 次提交
  18. 07 8月, 2019 2 次提交
  19. 29 7月, 2019 1 次提交
  20. 25 7月, 2019 1 次提交
    • J
      qemu: Add support for overriding max threads per process limit · d5572f62
      Jim Fehlig 提交于
      Some VM configurations may result in a large number of threads created by
      the associated qemu process which can exceed the system default limit. The
      maximum number of threads allowed per process is controlled by the pids
      cgroup controller and is set to 16k when creating VMs with systemd's
      machined service. The maximum number of threads per process is recorded
      in the pids.max file under the machine's pids controller cgroup hierarchy,
      e.g.
      
      $cgrp-mnt/pids/machine.slice/machine-qemu\\x2d1\\x2dtest.scope/pids.max
      
      Maximum threads per process is controlled with the TasksMax property of
      the systemd scope for the machine. This patch adds an option to qemu.conf
      which can be used to override the maximum number of threads allowed per
      qemu process. If the value of option is greater than zero, it will be set
      in the TasksMax property of the machine's scope after creating the machine.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      d5572f62