<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hello Cedric,</p>
<p><br>
</p>
<p>Please let me know if you need any additional information. I would also be able to help you test patches regarding this issue.</p>
<p>I'm looking forward to your findings.</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Frank<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Van:</b> Cedric Bosdonnat <cbosdonnat@suse.com><br>
<b>Verzonden:</b> donderdag 23 maart 2017 13:28:57<br>
<b>Aan:</b> Frank Schreuder; libvir-list@redhat.com<br>
<b>Onderwerp:</b> Re: [libvirt] Live attaching a disk to a VM fails with apparmor enabled</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hello Frank,<br>
<br>
I'm currently investigating some apparmor-related bug with namespaces. This one<br>
is surely related. I'll look into it when I'm done with the one I'm working on.<br>
<br>
--<br>
Cedric<br>
<br>
On Thu, 2017-03-23 at 12:07 +0000, Frank Schreuder wrote:<br>
> Hello,<br>
> <br>
> I'm running libvirt 3.1.0 on a Debian 8 server. I installed apparmor and configured libvirt to use apparmor as<br>
> security driver.<br>
> After booting a VM, virsh dumpxml shows an apparmor seclabel.<br>
> <br>
> As soon as I try to attach a second disk to the VM, apparmor blocks this.<br>
> <br>
> virsh attach-device test-vps /tmp/virshXmlDefinition<br>
> error: Failed to attach device from /tmp/virshXmlDefinition<br>
> error: operation failed: Could not open '/mnt/images/disk2.raw': Permission denied<br>
> <br>
> Syslogs shows me the following:<br>
> Mar 22 17:45:20 vps0 kernel: [1136647.318314] audit: type=1400 audit(1490201120.577:30): apparmor="DENIED"<br>
> operation="open" profile="libvirt-5747e4db-a3b7-fd69-ca89-00007b0bf859" name="/mnt/images/disk2.raw" pid=13453<br>
> comm="kvm" requested_mask="r" denied_mask="r" fsuid=996 ouid=33<br>
> Mar 22 17:45:20 vps0 kernel: [1136647.325155] audit: type=1400 audit(1490201120.577:31): apparmor="DENIED"<br>
> operation="open" profile="libvirt-5747e4db-a3b7-fd69-ca89-00007b0bf859" name="/mnt/images/disk2.raw" pid=13453<br>
> comm="kvm" requested_mask="rw" denied_mask="rw" fsuid=996 ouid=33<br>
> Mar 22 17:45:20 vps0 libvirtd[10282]: 2017-03-22 16:45:20.596+0000: 10283: error : qemuMonitorTextAddDrive:1968 :<br>
> operation failed: Could not open '/mnt/images/disk2.raw': Permission denied<br>
> <br>
> In the VM specific apparmor file /etc/apparmor.d/libvirt/libvirt-5747e4db-a3b7-fd69-ca89-00007b0bf859.files I see:<br>
> "/mnt/images/disk1.raw" rw,<br>
> <br>
> Which is my primary VM disk, I expected a virsh attach-device to append /mnt/images/disk2.raw to this file and<br>
> reload/refresh the apparmor profile?<br>
> <br>
> I'm not able to attach a live disk to a running VM with apparmor. Am I missing something? Or is this a bug/missing<br>
> feature in libvirt?<br>
> <br>
> Thanks,<br>
> Frank<br>
> --<br>
> libvir-list mailing list<br>
> libvir-list@redhat.com<br>
> <a href="https://www.redhat.com/mailman/listinfo/libvir-list">https://www.redhat.com/mailman/listinfo/libvir-list</a><br>
</div>
</span></font>
</body>
</html>