Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 629718 - >=app-emulation/libvirt-6.2.0 current apparmor profile doesn't allow to use seavgabios (sys-firmware/seabios)
Summary: >=app-emulation/libvirt-6.2.0 current apparmor profile doesn't allow to use s...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2017-09-03 00:37 UTC by aporilel
Modified: 2020-09-05 07:53 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for libvirt-3.8.0-r1 (patch,341 bytes, patch)
2017-11-14 04:54 UTC, aporilel
Details | Diff
correct patch (libvirt-3.10.0-r1-fix_paths_for_apparmor.patch,2.67 KB, patch)
2018-01-22 11:07 UTC, aporilel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description aporilel 2017-09-03 00:37:51 UTC
abstraction /etc/apparmor.d/abstractions/libvirt-qemu contains only these rules:
  /usr/share/vgabios/** r,
  /usr/share/seabios/** r,

since qemu has been updated, it's now using seavgabios instead of vgabios, so this rule should be added:
  /usr/share/seavgabios/** r,




patch for app-emulation/libvirt

--- a/examples/apparmor/libvirt-qemu
+++ b/examples/apparmor/libvirt-qemu
@@ -69,6 +69,7 @@
   /usr/share/proll/** r,
   /usr/share/vgabios/** r,
   /usr/share/seabios/** r,
+  /usr/share/seavgabios/** r,
   /usr/share/ovmf/** r,

   # access PKI infrastructure
Comment 1 aporilel 2017-09-03 00:48:01 UTC
ALSO

the rule is needed for UEFI domains using the new package sys-firmware/edk2-ovmf (it installs into /usr/share/edk2-ovmf/,
whereas default rule is for /usr/share/ovmf/)



as a result more full patch:

--- a/examples/apparmor/libvirt-qemu
+++ b/examples/apparmor/libvirt-qemu
@@ -69,7 +69,9 @@
   /usr/share/proll/** r,
   /usr/share/vgabios/** r,
   /usr/share/seabios/** r,
+  /usr/share/seavgabios/** r,
   /usr/share/ovmf/** r,
+  /usr/share/edk2-ovmf/** r,
 
   # access PKI infrastructure
   /etc/pki/libvirt-vnc/** r,
Comment 2 aporilel 2017-09-27 14:48:49 UTC
Also, (i won't file a new bug, it's about apparmor too) since qemu-2.10.0 was stabilized, dynamically created rules for virtual drive and nvram images should allow to lock these files (rule 'k')
it was fixed in libvirt-3.7.0, so please bump in portage tree (now it's 3.6.0 only even in ~arch) or include these patches:
https://libvirt.org/git/?p=libvirt.git;a=patch;h=580cdaa7e7ba9e03303e06ff7ed487b6908efd09
https://libvirt.org/git/?p=libvirt.git;a=patch;h=03fb4e3deaa18d292810b21c23e2f8e06a435821

The patch (for initial bug) for seavgabios patch and edk2-ovmf is actual (not fixed in upstream)
Comment 3 aporilel 2017-11-14 04:48:42 UTC
for libvirt-3.8.0-r1 and libvirt-3.9.0
the patch is still needed
Comment 4 aporilel 2017-11-14 04:54:13 UTC
Created attachment 504136 [details, diff]
patch for libvirt-3.8.0-r1
Comment 5 Larry the Git Cow gentoo-dev 2017-12-07 16:08:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24cd72c425327c6e1267416c9f170eefdd7affb7

commit 24cd72c425327c6e1267416c9f170eefdd7affb7
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2017-12-07 15:54:55 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2017-12-07 16:02:12 +0000

    app-emulation/libvirt: Update apparmor profiles
    
    Closes: https://bugs.gentoo.org/629718
    Package-Manager: Portage-2.3.16, Repoman-2.3.6

 .../libvirt-3.10.0-fix_paths_for_apparmor.patch    | 118 +++++++++++++++++++++
 app-emulation/libvirt/libvirt-3.10.0.ebuild        |   2 +-
 2 files changed, 119 insertions(+), 1 deletion(-)
Comment 6 aporilel 2017-12-14 22:40:19 UTC
You have fully removed the profile 'usr.lib.libvirt.virt-aa-helper' in the new patch, but it should be renamed to 'usr.libexec.virt-aa-helper' with the fix (it's not necessary to change this part relative to previous version)
Comment 7 aporilel 2018-01-22 11:07:13 UTC
Created attachment 515826 [details, diff]
correct patch

the correct version of the patch, doesn't breaking usr.libexec.virt-aa-helper
Comment 8 Larry the Git Cow gentoo-dev 2018-01-30 17:08:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=002a0f6216825de8c045768a5baeeaf862339497

commit 002a0f6216825de8c045768a5baeeaf862339497
Author:     aporilel <35788283+aporilel@users.noreply.github.com>
AuthorDate: 2018-01-25 02:23:36 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2018-01-30 17:03:10 +0000

    app-emulation/libvirt: fix apparmor patch
    
    Fixes: 24cd72c425327c6 ("app-emulation/libvirt: Update apparmor profiles")
    Closes: https://bugs.gentoo.org/629718
    Closes: https://github.com/gentoo/gentoo/pull/6954
    
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 .../libvirt-3.10.0-r2-fix_paths_for_apparmor.patch |  77 +++++
 app-emulation/libvirt/libvirt-3.10.0-r2.ebuild     | 382 +++++++++++++++++++++
 2 files changed, 459 insertions(+)
Comment 9 aporilel 2020-04-11 09:30:33 UTC
the same problem (missing rule for seavgabios) in libvirt-6.1.0 and 6.2.0
Comment 10 Larry the Git Cow gentoo-dev 2020-09-05 07:53:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4d74d2fec11558f4de07a0411e143d5dbe2db72

commit a4d74d2fec11558f4de07a0411e143d5dbe2db72
Author:     aporilel <aporilel@yandex.ru>
AuthorDate: 2020-08-23 11:20:28 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-09-05 07:53:46 +0000

    app-emulation/libvirt: add apparmor rule for seavgabios
    
    Closes: https://bugs.gentoo.org/629718
    Signed-off-by: Anton Smirnov <aporilel@yandex.ru>
    Closes: https://github.com/gentoo/gentoo/pull/15255
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 .../libvirt-6.5.0-fix-paths-for-apparmor.patch     | 82 ++++++++++++++++++++++
 ...ibvirt-6.5.0.ebuild => libvirt-6.5.0-r1.ebuild} |  2 +-
 2 files changed, 83 insertions(+), 1 deletion(-)