From nobody Thu May 2 11:54:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1502961174442738.3348048278883; Thu, 17 Aug 2017 02:12:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7890B2E95A2; Thu, 17 Aug 2017 09:12:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4D285C6C9; Thu, 17 Aug 2017 09:12:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8BA881806106; Thu, 17 Aug 2017 09:12:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7H9Cmam003261 for ; Thu, 17 Aug 2017 05:12:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 78428612B3; Thu, 17 Aug 2017 09:12:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 738DC6C1E0 for ; Thu, 17 Aug 2017 09:12:45 +0000 (UTC) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA49E7ACCF for ; Thu, 17 Aug 2017 09:12:43 +0000 (UTC) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1diGaf-0000v1-IC; Thu, 17 Aug 2017 08:55:45 +0000 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7890B2E95A2 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7890B2E95A2 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AA49E7ACCF Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=christian.ehrhardt@canonical.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AA49E7ACCF From: Christian Ehrhardt To: Libvirt Devel Date: Thu, 17 Aug 2017 10:55:43 +0200 Message-Id: <1502960143-3699-1-git-send-email-christian.ehrhardt@canonical.com> X-Greylist: Delayed for 00:16:56 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 17 Aug 2017 09:12:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 17 Aug 2017 09:12:44 +0000 (UTC) for IP:'91.189.89.112' DOMAIN:'youngberry.canonical.com' HELO:'youngberry.canonical.com' FROM:'christian.ehrhardt@canonical.com' RCPT:'' X-RedHat-Spam-Score: -2.301 (RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD) 91.189.89.112 youngberry.canonical.com 91.189.89.112 youngberry.canonical.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: intrigeri , Guido Guenther , Christian Ehrhardt Subject: [libvirt] [PATCH] virt-aa-helper: locking loader/nvram for qemu 2.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 17 Aug 2017 09:12:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Testing qemu-2.10-rc3 shows issues like: qemu-system-aarch64: -drive file=3D/home/ubuntu/vm-start-stop/vms/ 7936-0_CODE.fd,if=3Dpflash,format=3Draw,unit=3D1: Failed to unlock byte 1= 00 There is an apparmor deny due to qemu now locking those files: apparmor=3D"DENIED" operation=3D"file_lock" [...] name=3D"/home/ubuntu/vm-start-stop/vms/7936-0_CODE.fd" name=3D"/var/lib/uvtool/libvirt/images/kvmguest-artful-normal.qcow" [...] comm=3D"qemu-system-aarch64" requested_mask=3D"k" denied_mask=3D"k" The profile needs to allow locking for loader and nvram files via the locking (k) rule. Signed-off-by: Christian Ehrhardt --- src/security/virt-aa-helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index ab82f12..2308323 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1029,11 +1029,11 @@ get_files(vahControl * ctl) goto cleanup; =20 if (ctl->def->os.loader && ctl->def->os.loader->path) - if (vah_add_file(&buf, ctl->def->os.loader->path, "r") !=3D 0) + if (vah_add_file(&buf, ctl->def->os.loader->path, "rk") !=3D 0) goto cleanup; =20 if (ctl->def->os.loader && ctl->def->os.loader->nvram) - if (vah_add_file(&buf, ctl->def->os.loader->nvram, "rw") !=3D 0) + if (vah_add_file(&buf, ctl->def->os.loader->nvram, "rwk") !=3D 0) goto cleanup; =20 for (i =3D 0; i < ctl->def->ngraphics; i++) { --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list