1. 05 6月, 2017 1 次提交
  2. 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
  3. 22 10月, 2016 1 次提交
  4. 26 9月, 2016 1 次提交
  5. 08 9月, 2016 2 次提交
    • J
      security: Fixing wrong label in virt-aa-helper.c. · fe94ee5d
      Julio Faracco 提交于
      There is an issue with a wrong label inside vah_add_path().
      The compilation fails with the error:
      make[3]: Entering directory '/tmp/libvirt/src'
        CC       security/virt_aa_helper-virt-aa-helper.o
      security/virt-aa-helper.c: In function 'vah_add_path':
      security/virt-aa-helper.c:769:9: error: label 'clean' used but not defined
               goto clean;
      
      This patch moves 'clean' label to 'cleanup' label.
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      fe94ee5d
    • R
      Avoid segfault in virt-aa-helper when handling read-only filesystems · b3c1bcb9
      Rufo Dogav 提交于
      This patch fixes a segfault in virt-aa-helper caused by attempting to
      modify a static string literal. It is triggered when a domain has a
      <filesystem> with type='mount' configured read-only and libvirt is
      using the AppArmor security driver for sVirt confinement. An "R" is
      passed into the function and converted to 'r'.
      b3c1bcb9
  6. 22 7月, 2016 1 次提交
  7. 19 7月, 2016 2 次提交
    • C
      virt-aa-helper: better write denials handling · cedd2ab2
      Cédric Bosdonnat 提交于
      Better fix replacing c726af2d: introducing an 'R' permission to
      add read rule, but no explicit deny write rule.
      cedd2ab2
    • J
      security: compilation error due to wrong parameter for vah_add_path(). · fc624d86
      Julio Faracco 提交于
      The commit da665fbd introduced virStorageSourcePtr inside the structure
      _virDomainFSDef. This is causing an error when libvirt is being compiled.
      
      make[3]: Entering directory `/media/julio/8d65c59c-6ade-4740-9cdc-38016a4cb8ae
      /home/julio/Desktop/virt/libvirt/src'
        CC       security/virt_aa_helper-virt-aa-helper.o
      security/virt-aa-helper.c: In function 'get_files':
      security/virt-aa-helper.c:1087:13: error: passing argument 2 of 'vah_add_path'
      from incompatible pointer type [-Werror]
                   if (vah_add_path(&buf, fs->src, "rw", true) != 0)
                   ^
      security/virt-aa-helper.c:732:1: note: expected 'const char *' but argument is
      of type 'virStorageSourcePtr'
       vah_add_path(virBufferPtr buf, const char *path, const char *perms, bool
      recursive)
       ^
      cc1: all warnings being treated as errors
      
      Adding the attribute "path" from virStorageSourcePtr fixes this issue.
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      fc624d86
  8. 09 6月, 2016 2 次提交
    • P
      vnc: add support for listen type 'socket' · acc83afe
      Pavel Hrdina 提交于
      VNC graphics already supports sockets but only via 'socket' attribute.
      This patch coverts that attribute into listen type 'socket'.
      
      For backward compatibility we need to handle listen type 'socket' and 'socket'
      attribute properly to support old XMLs and new XMLs.  If both are provided they
      have to match, if only one of them is provided we need to be able to parse that
      configuration too.
      
      To not break migration back to old libvirt if the socket is provided by user we
      need to generate migratable XML without the listen element and use only 'socket'
      attribute.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      acc83afe
    • P
      graphics: introduce new listen type 'socket' · b6465e1a
      Pavel Hrdina 提交于
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      b6465e1a
  9. 07 6月, 2016 1 次提交
    • P
      conf: Add infrastructure for adding configuration validation · b394af16
      Peter Krempa 提交于
      Until now we weren't able to add checks that would reject configuration
      once accepted by the parser. This patch adds a new callback and
      infrastructure to add such checks. In this patch all the places where
      rejecting a now-invalid configuration wouldn't be a good idea are marked
      with a new parser flag.
      b394af16
  10. 25 5月, 2016 1 次提交
  11. 13 5月, 2016 1 次提交
  12. 20 4月, 2016 1 次提交
  13. 15 4月, 2016 1 次提交
  14. 02 4月, 2016 1 次提交
    • G
      apparmor: QEMU monitor socket moved · dfbc9a83
      Guido Günther 提交于
      The directory name changed in a89f05ba.
      
      This unbreaks launching QEMU/KVM VMs with apparmor enabled. It also adds
      the directory for the qemu guest-agent socket which is not known when
      parsing the domain XML.
      dfbc9a83
  15. 14 1月, 2016 1 次提交
    • C
      virt-aa-helper: don't deny writes to readonly mounts · c726af2d
      Cédric Bosdonnat 提交于
      There is no need to deny writes on a readonly mount: write still
      won't be accepted, even if the user remounts the folder as RW in
      the guest as qemu sets the 9p mount as ro.
      
      This deny rule was leading to problems for example with readonly /:
      The qemu process had to write to a bunch of files in / like logs,
      sockets, etc. This deny rule was also preventing auditing of these
      denials, making it harder to debug.
      c726af2d
  16. 30 8月, 2015 1 次提交
  17. 27 8月, 2015 1 次提交
    • M
      virt-aa-helper: Improve valid_path · 52970dec
      Michal Privoznik 提交于
      So, after some movement in virt-aa-helper, I've noticed the
      virt-aa-helper-test failing. I've ran gdb (it took me a while to
      realize how to do that) and this showed up immediately:
      
        Program received signal SIGSEGV, Segmentation fault.
        strlen () at ../sysdeps/x86_64/strlen.S:106
        106     ../sysdeps/x86_64/strlen.S: No such file or directory.
        (gdb) bt
        #0  strlen () at ../sysdeps/x86_64/strlen.S:106
        #1  0x0000555555561a13 in array_starts_with (str=0x5555557ce910 "/tmp/tmp.6nI2Fkv0KL/1.img", arr=0x7fffffffd160, size=-1540438016) at security/virt-aa-helper.c:525
        #2  0x0000555555561d49 in valid_path (path=0x5555557ce910 "/tmp/tmp.6nI2Fkv0KL/1.img", readonly=false) at security/virt-aa-helper.c:617
        #3  0x0000555555562506 in vah_add_path (buf=0x7fffffffd3e0, path=0x5555557cb910 "/tmp/tmp.6nI2Fkv0KL/1.img", perms=0x555555581585 "rw", recursive=false) at security/virt-aa-helper.c:823
        #4  0x0000555555562693 in vah_add_file (buf=0x7fffffffd3e0, path=0x5555557cb910 "/tmp/tmp.6nI2Fkv0KL/1.img", perms=0x555555581585 "rw") at security/virt-aa-helper.c:854
        #5  0x0000555555562918 in add_file_path (disk=0x5555557d4440, path=0x5555557cb910 "/tmp/tmp.6nI2Fkv0KL/1.img", depth=0, opaque=0x7fffffffd3e0) at security/virt-aa-helper.c:931
        #6  0x00007ffff78f18b1 in virDomainDiskDefForeachPath (disk=0x5555557d4440, ignoreOpenFailure=true, iter=0x5555555628a6 <add_file_path>, opaque=0x7fffffffd3e0) at conf/domain_conf.c:23286
        #7  0x0000555555562b5f in get_files (ctl=0x7fffffffd670) at security/virt-aa-helper.c:982
        #8  0x0000555555564100 in vahParseArgv (ctl=0x7fffffffd670, argc=5, argv=0x7fffffffd7e8) at security/virt-aa-helper.c:1277
        #9  0x00005555555643d6 in main (argc=5, argv=0x7fffffffd7e8) at security/virt-aa-helper.c:1332
      
      So I've taken look at valid_path() because it is obviously
      calling array_starts_with() with malformed @size. And here's the
      result: there are two variables to hold the size of three arrays
      and their value is recalculated before each call of
      array_starts_with(). What if we just use three variables,
      initialize them and do not touch them afterwards?
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      52970dec
  18. 26 8月, 2015 1 次提交
    • P
      virt-aa-helper: add NVRAM store file for read/write · 91fdcefa
      Peter Kieser 提交于
      This is a cryptographically signed message in MIME format.
      
      Some UEFI firmwares may want to use a non-volatile memory to store some
      variables.
      If AppArmor is enabled, and NVRAM store file is set currently
      virt-aa-helper does
      not add the NVRAM store file to the template. Add this file for
      read/write when
      this functionality is defined in domain XML.
      Signed-off-by: NPeter Kieser <peter@kieser.ca>
      91fdcefa
  19. 24 8月, 2015 3 次提交
  20. 10 7月, 2015 4 次提交
  21. 08 7月, 2015 1 次提交
  22. 02 7月, 2015 1 次提交
  23. 21 4月, 2015 2 次提交
  24. 14 4月, 2015 1 次提交
  25. 14 1月, 2015 1 次提交
    • D
      Give virDomainDef parser & formatter their own flags · 0ecd6851
      Daniel P. Berrange 提交于
      The virDomainDefParse* and virDomainDefFormat* methods both
      accept the VIR_DOMAIN_XML_* flags defined in the public API,
      along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
      defined in domain_conf.c.
      
      This is seriously confusing & error prone for a number of
      reasons:
      
       - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
         VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
         formatting operation
       - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
         to parse or to format, but not both.
      
      This patch cleanly separates out the flags. There are two
      distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
      flags that are used by the corresponding methods. The
      VIR_DOMAIN_XML_* flags received via public API calls must
      be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
      needed.
      
      The various calls to virDomainDefParse which hardcoded the
      use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
      VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
      0ecd6851
  26. 25 11月, 2014 3 次提交
  27. 15 11月, 2014 2 次提交
  28. 30 10月, 2014 1 次提交