<div dir="ltr">Thanks everybody,<div>pushed with the commit message cleaned up and acks/reviews added.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 12, 2018 at 2:39 PM, Jamie Strandboge <span dir="ltr"><<a href="mailto:jamie@canonical.com" target="_blank">jamie@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, 2018-06-11 at 13:52 +0200, Christian Ehrhardt wrote:<br>
> The base vfio has not much functionality but to provide a custom<br>
> container by opening this path.<br>
> See <a href="https://www.kernel.org/doc/Documentation/vfio.txt" rel="noreferrer" target="_blank">https://www.kernel.org/doc/<wbr>Documentation/vfio.txt</a> for more.<br>
> <br>
> Systems with static hostdevs will get /dev/vfio/vfio by virt-aa-<br>
> hotplug<br>
> right from the beginning. But if the guest initially had no hostdev<br>
> at<br>
> all it will run into the following deny before the security module<br>
> labelling callbacks will make the actual vfio device (like<br>
> /dev/vfio/93)<br>
> known.<br>
> <br>
> Access by qemu is "wr" even thou in theory it could maybe be "r":<br>
> [ 2652.756712] audit: type=1400 audit(1491303691.719:25):<br>
>   apparmor="DENIED" operation="open"<br>
>   profile="libvirt-17a61b87-<wbr>5132-497c-b928-421ac2ee0c8a"<br>
>   name="/dev/vfio/vfio" pid=8486 comm="qemu-system-x86"<br>
>   requested_mask="wr" denied_mask="wr" fsuid=64055 ouid=0<br>
> <br>
> Bug-Ubuntu: <a href="https://bugs.launchpad.net/bugs/1678322" rel="noreferrer" target="_blank">https://bugs.launchpad.net/<wbr>bugs/1678322</a><br>
> Bug-Ubuntu: <a href="https://bugs.launchpad.net/bugs/1775777" rel="noreferrer" target="_blank">https://bugs.launchpad.net/<wbr>bugs/1775777</a><br>
> <br>
> Signed-off-by: Christian Ehrhardt <<a href="mailto:christian.ehrhardt@canonical.com">christian.ehrhardt@canonical.<wbr>com</a>><br>
> Signed-off-by: Stefan Bader <<a href="mailto:stefan.bader@canonical.com">stefan.bader@canonical.com</a>><br>
> ---<br>
>  examples/apparmor/libvirt-qemu | 3 +++<br>
>  1 file changed, 3 insertions(+)<br>
> <br>
> diff --git a/examples/apparmor/libvirt-<wbr>qemu<br>
> b/examples/apparmor/libvirt-<wbr>qemu<br>
> index 2c47652250..874aca2092 100644<br>
> --- a/examples/apparmor/libvirt-<wbr>qemu<br>
> +++ b/examples/apparmor/libvirt-<wbr>qemu<br>
> @@ -193,6 +193,9 @@<br>
>    deny /dev/shm/lttng-ust-wait-* r,<br>
>    deny /run/shm/lttng-ust-wait-* r,<br>
>  <br>
> +  # for vfio hotplug on systems without static vfio (LP: #1775777)<br>
> +  /dev/vfio/vfio rw,<br>
> +<br>
<br>
</div></div>Makes sense. If the guest doesn't start with vfio then libvirtd is<br>
going to have to give it to the guest and so libvirtd would need this<br>
access. +1 to apply.<br>
<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Jamie Strandboge             | <a href="http://www.canonical.com" rel="noreferrer" target="_blank">http://www.canonical.com</a></font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(136,136,136);font-size:12.8px">Christian Ehrhardt</span><div style="color:rgb(136,136,136);font-size:12.8px">Software Engineer, Ubuntu Server</div><div style="color:rgb(136,136,136);font-size:12.8px">Canonical Ltd</div></div></div></div></div>
</div>