You need to sign in or sign up before continuing.
- 10 1月, 2018 1 次提交
-
-
由 Christian Ehrhardt 提交于
This is now covered by DomainSetPathLabel being implemented in apparmor. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
- 27 10月, 2017 1 次提交
-
-
由 Christian Ehrhardt 提交于
Some globbing chars in the domain name could be used to break out of apparmor rules, so lets forbid these when in virt-aa-helper. Also adding a test to ensure all those cases were detected as bad char. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
- 26 10月, 2017 1 次提交
-
-
由 Christian Ehrhardt 提交于
Hot-adding disks does not parse the full XML to generate apparmor rules. Instead it uses -f <PATH> to append a generic rule for that file path. 580cdaa7: "virt-aa-helper: locking disk files for qemu 2.10" implemented the qemu 2.10 requirement to allow locking on disks images that are part of the domain xml. But on attach-device a user will still trigger an apparmor deny by going through virt-aa-helper -f, to fix that add the lock "k" permission to the append file case of virt-aa-helper. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
- 17 10月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
Add helpers that will simplify checking if a backing file is valid or whether it has backing store. The helper virStorageSourceIsBacking returns true if the given virStorageSource is a valid backing store member. virStorageSourceHasBacking returns true if the virStorageSource has a backing store child. Adding these functions creates a central points for further refactors.
-
- 06 10月, 2017 3 次提交
-
-
由 Christian Ehrhardt 提交于
To avoid any issues later on if paths ever change (unlikely but possible) and to match the style of other generated rules the paths of the static rules have to be quoted as well. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
由 Christian Ehrhardt 提交于
libvirt allows spaces in vm names, there were issues in the past but it seems not removed so the assumption has to be that spaces are continuing to be allowed. Therefore virt-aa-helper should not reject spaces in vm names anymore if it is going to be refused causing issues then the parser or xml schema should do so. Apparmor rules are in quotes, so a space in a path based on the name works. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Christian Ehrhardt 提交于
If users only specified vendor&product (the common case) then parsing the xml via virDomainHostdevSubsysUSBDefParseXML would only set these. Bus and Device would much later be added when the devices are prepared to be added. Due to that a hot-add of a usb hostdev works as the device is prepared and virt-aa-helper processes the new internal xml. But on an initial guest start at the time virt-aa-helper renders the apparmor rules the bus/device id's are not set yet: p ctl->def->hostdevs[0]->source.subsys.u.usb $12 = {autoAddress = false, bus = 0, device = 0, vendor = 1921, product = 21888} That causes rules to be wrong: "/dev/bus/usb/000/000" rw, The fix calls virHostdevFindUSBDevice after reading the XML from virt-aa-helper to only add apparmor rules for devices that could be found and now are fully known to be able to write the rule correctly. It uncondtionally sets virHostdevFindUSBDevice mandatory attribute as adding an apparmor rule for a device not found makes no sense no matter what startup policy it has set. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 19 9月, 2017 1 次提交
-
-
由 Guido Günther 提交于
Things moved again, sigh. Reviewed-By: NJamie Strandboge <jamie@canonical.com> Michal Privoznik <mprivozn@redhat.com>
-
- 17 8月, 2017 2 次提交
-
-
由 Christian Ehrhardt 提交于
Testing qemu-2.10-rc3 shows issues like: qemu-system-aarch64: -drive file=/home/ubuntu/vm-start-stop/vms/ 7936-0_CODE.fd,if=pflash,format=raw,unit=1: Failed to unlock byte 100 There is an apparmor deny due to qemu now locking those files: apparmor="DENIED" operation="file_lock" [...] name="/home/ubuntu/vm-start-stop/vms/7936-0_CODE.fd" name="/var/lib/uvtool/libvirt/images/kvmguest-artful-normal.qcow" [...] comm="qemu-system-aarch64" requested_mask="k" denied_mask="k" The profile needs to allow locking for loader and nvram files via the locking (k) rule. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
由 Christian Ehrhardt 提交于
Testing qemu-2.10-rc2 shows issues like: qemu-system-x86_64: -drive file=/var/lib/uvtool/libvirt/images/kvmguest- \ artful-normal.qcow,format=qcow2,if=none,id=drive-virtio-disk0: Failed to lock byte 100 It seems the following qemu commit changed the needs for the backing image rules: (qemu) commit 244a5668106297378391b768e7288eb157616f64 Author: Fam Zheng <famz@redhat.com> file-posix: Add image locking to perm operations The block appears as: apparmor="DENIED" operation="file_lock" [...] name="/var/lib/uvtool/libvirt/images/kvmguest-artful-normal.qcow" [...] comm="qemu-system-x86" requested_mask="k" denied_mask="k" With that qemu change in place the rules generated for the image and backing files need the allowance to also lock (k) the files. Disks are added via add_file_path and with this fix rules now get that permission, but no other rules are changed, example: - "/var/lib/uvtool/libvirt/images/kvmguest-artful-normal-a2.qcow" rw, + "/var/lib/uvtool/libvirt/images/kvmguest-artful-normal-a2.qcow" rwk Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
- 14 8月, 2017 1 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 27 7月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
In commit 5e515b54 I've attempted to fix the inability to access storage from the apparmor helper program by linking with the storage driver. By linking with the .so the linker complains that it's not portable. Fix this by loading the module dynamically as we are supposed to do. Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 19 7月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
The refactor to split up storage driver into modules broke the apparmor helper program, since that did not initialize the storage driver properly and thus detection of the backing chain could not work. Register the storage driver backends explicitly. Unfortunately it's now necessary to link with the full storage driver to satisfy dependencies of the loadable modules. Reviewed-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com> Reported-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com> Tested-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
- 11 7月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
The helper methods for actually accessing the storage objects don't really belong to the main storage driver implementation file. Split them out.
-
- 16 6月, 2017 2 次提交
-
-
由 William Grant 提交于
Allow access to aarch64 UEFI images. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com> Signed-off-by: NStefan Bader <stefan.bader@canonical.com> Acked-by: NGuido Günther <agx@sigxcpu.org>
-
由 Simon McVittie 提交于
The split firmware and variables files introduced by https://bugs.debian.org/764918 are in a different directory for some reason. Let the virtual machine read both. Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com> Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
-
- 07 6月, 2017 1 次提交
-
-
由 Jiri Denemark 提交于
virDomainXMLOption gains driver specific callbacks for parsing and formatting save cookies. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
-
- 05 6月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
While checking for ABI stability, drivers might pose additional checks that are not valid for general case. For instance, qemu driver might check some memory backing attributes because of how qemu works. But those attributes may work well in other drivers. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 30 11月, 2016 1 次提交
-
-
由 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>
-
- 22 10月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Change the virDomainChrDef to use a pointer to 'source' and allocate that pointer during virDomainChrDefNew. This has tremendous "fallout" in the rest of the code which mainly has to change source.$field to source->$field. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 26 9月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
We want to pass the proper opaque pointer instead of NULL to virDomainDefParse and subsequently virDomainDefParseNode too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 08 9月, 2016 2 次提交
-
-
由 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>
-
由 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'.
-
- 22 7月, 2016 1 次提交
-
-
由 Guido Günther 提交于
-
- 19 7月, 2016 2 次提交
-
-
由 Cédric Bosdonnat 提交于
Better fix replacing c726af2d: introducing an 'R' permission to add read rule, but no explicit deny write rule.
-
由 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>
-
- 09 6月, 2016 2 次提交
-
-
由 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>
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 07 6月, 2016 1 次提交
-
-
由 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.
-
- 25 5月, 2016 1 次提交
-
-
由 Ján Tomko 提交于
Add support for the slic_table to the security drivers.
-
- 13 5月, 2016 1 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 20 4月, 2016 1 次提交
-
-
由 Simon Arlott 提交于
The VM does not need read permission for its own VNC socket to create(), bind(), accept() connections or to receive(), send(), etc. on connections. https://bugzilla.redhat.com/show_bug.cgi?id=1312573
-
- 15 4月, 2016 1 次提交
-
-
由 Cole Robinson 提交于
Take setlocale/gettext error handling pattern from tools/virsh-* and use it for all standalone binaries via a new shared virGettextInitialize routine. The virsh* pattern differed slightly from other callers. All users now consistently: * Ignore setlocale errors. virsh has done this forever, presumably for good reason. This has been partially responsible for some bug reports: https://bugzilla.redhat.com/show_bug.cgi?id=1312688 https://bugzilla.redhat.com/show_bug.cgi?id=1026514 https://bugzilla.redhat.com/show_bug.cgi?id=1016158 * Report the failed function name * Report strerror
-
- 02 4月, 2016 1 次提交
-
-
由 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.
-
- 14 1月, 2016 1 次提交
-
-
由 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.
-
- 30 8月, 2015 1 次提交
-
-
由 Guido Günther 提交于
f1f68ca3 moved the monitor socket to a per domain directory. Adjust the path accordingly.
-
- 27 8月, 2015 1 次提交
-
-
由 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>
-
- 26 8月, 2015 1 次提交
-
-
由 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>
-
- 24 8月, 2015 2 次提交
-
-
由 intrigeri 提交于
We forbid access to /usr/share/, but (at least on Debian-based systems) the Open Virtual Machine Firmware files needed for booting UEFI virtual machines in QEMU live in /usr/share/ovmf/. Therefore, we need to add that directory to the list of read only paths. A similar patch was suggested by Jamie Strandboge <jamie@canonical.com> on https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1483071.
-
由 Guido Günther 提交于
First check overrides, then read only files then restricted access itself. This allows us to mark files for read only access whose parents were already restricted for read write. Based on a proposal by Martin Kletzander
-