[libvirt] [PATCH 12/12] apparmor, virt-aa-helper: Allow access to /sys/bus/usb/devices

Jamie Strandboge jamie at canonical.com
Tue Dec 19 16:37:24 UTC 2017


On Tue, 2017-12-19 at 16:03 +0100, Christian Ehrhardt wrote:
> From: Jamie Strandboge <jamie at ubuntu.com>
> 
> Required to generate correct profiles when using usb passthrough.
> 
> Bug-Ubuntu: https://bugs.launchpad.net/bugs/565691
> 
> Signed-off-by: Stefan Bader <stefan.bader at canonical.com>
> ---
>  examples/apparmor/usr.lib.libvirt.virt-aa-helper | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/examples/apparmor/usr.lib.libvirt.virt-aa-helper
> b/examples/apparmor/usr.lib.libvirt.virt-aa-helper
> index d63c844..de92291 100644
> --- a/examples/apparmor/usr.lib.libvirt.virt-aa-helper
> +++ b/examples/apparmor/usr.lib.libvirt.virt-aa-helper
> @@ -22,6 +22,8 @@ profile virt-aa-helper
> /usr/{lib,lib64}/libvirt/virt-aa-helper {
>    # for hostdev
>    /sys/devices/ r,
>    /sys/devices/** r,
> +  /sys/bus/usb/devices/ r,
> +  /sys/bus/usb/devices/** r,
>    deny /dev/sd* r,
>    deny /dev/vd* r,
>    deny /dev/dm-* r,

Note that only the first rule is needed since /sys/bus/usb/devices/ is
a symlink farm (at least these days). AppArmor resolves symlinks before
applying mediation so the glob rule won't ever match anything.

+1 for first rule.

-- 
Jamie Strandboge             | http://www.canonical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171219/ed257e73/attachment-0001.sig>


More information about the libvir-list mailing list