From nobody Thu May 2 06:08:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=kevinlocke.name ARC-Seal: i=1; a=rsa-sha256; t=1598271452; cv=none; d=zohomail.com; s=zohoarc; b=A6reBLF8VR2Y88jrZ/uTZzXRpJ1jtjCNoWWfM69aWdJMNYrhi+I2CsOTpRnMOT/4gkthEK1LkoHfL7ZjQzXav/ppdHmM4jbiCNubcLml9USiEw8kel++x4uGUjfalkejgeJ8odxEIpwKAqgD1D6K/e3rHZeS9TehOmFa+FJegRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598271452; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=uRyskHpvBUAW12Co6M4eriKg0QbjsgWjaOhhBDhPU7Q=; b=EqeWoQUViHPPi35fvRtouwxjRpYuzmxDhcESxyTRg8g6x4E2JyB0xFn5SGH8W3maHOqtOiUrk61SwEFBb5UHxxZscTY5aFjGMwnZCJutTdM/md2iML4Rt4IB9e3dfbQzALK8WTSVeKoa0ujKCblSG3U7It2a7xUzfrkDB4k+25o= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 15982714528351015.2676626728077; Mon, 24 Aug 2020 05:17:32 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-2b6WbDkXNUKo67TuVqAtEA-1; Mon, 24 Aug 2020 08:17:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5835D1005CA7; Mon, 24 Aug 2020 12:17:07 +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 B61331972A; Mon, 24 Aug 2020 12:17:06 +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 0347218A0B65; Mon, 24 Aug 2020 12:17:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07OC9PL5031059 for ; Mon, 24 Aug 2020 08:09:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5E5242022780; Mon, 24 Aug 2020 12:09:25 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 594E5202279A for ; Mon, 24 Aug 2020 12:09:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1D2F8901845 for ; Mon, 24 Aug 2020 12:09:23 +0000 (UTC) Received: from vulcan.kevinlocke.name (vulcan.kevinlocke.name [107.191.43.88]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-203-BMxiBviYNfO74-PjCtnS2A-1; Mon, 24 Aug 2020 08:09:17 -0400 Received: from kevinlocke.name (host-69-145-60-23.bln-mt.client.bresnan.net [69.145.60.23]) (Authenticated sender: kevin@kevinlocke.name) by vulcan.kevinlocke.name (Postfix) with ESMTPSA id 0D6AF1BAA507; Mon, 24 Aug 2020 12:03:36 +0000 (UTC) Received: by kevinlocke.name (Postfix, from userid 1000) id AFA871300561; Mon, 24 Aug 2020 06:03:34 -0600 (MDT) X-MC-Unique: 2b6WbDkXNUKo67TuVqAtEA-1 X-MC-Unique: BMxiBviYNfO74-PjCtnS2A-1 From: Kevin Locke To: libvir-list@redhat.com Subject: [PATCH] apparmor: allow libvirtd to call virtiofsd Date: Mon, 24 Aug 2020 06:03:34 -0600 Message-Id: MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 07OC9PL5031059 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 24 Aug 2020 08:17:03 -0400 Cc: Christian Ehrhardt 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When using [virtiofs], libvirtd must launch [virtiofsd] to provide filesystem access on the host. When a guest is configured with virtiofs, such as: Attempting to start the guest fails with: internal error: virtiofsd died unexpectedly /var/log/libvirt/qemu/$name-fs0-virtiofsd.log contains: libvirt: error : cannot execute binary /usr/lib/qemu/virtiofsd: Permis= sion denied dmesg contains: audit: type=3D1400 audit(1598229295.959:73): apparmor=3D"DENIED" operat= ion=3D"exec" profile=3D"libvirtd" name=3D"/usr/lib/qemu/virtiofsd" pid=3D46= 007 comm=3D"rpc-worker" requested_mask=3D"x" denied_mask=3D"x" fsuid=3D0 ou= id=3D0 To avoid this, allow execution of virtiofsd from the libvirtd AppArmor profile. [virtiofs]: https://libvirt.org/kbase/virtiofs.html [virtiofsd]: https://www.qemu.org/docs/master/interop/virtiofsd.html Signed-off-by: Kevin Locke Reviewed-by: Christian Ehrhardt --- src/security/apparmor/usr.sbin.libvirtd.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/security/apparmor/usr.sbin.libvirtd.in b/src/security/appa= rmor/usr.sbin.libvirtd.in index 4518e8f865..f2030764cd 100644 --- a/src/security/apparmor/usr.sbin.libvirtd.in +++ b/src/security/apparmor/usr.sbin.libvirtd.in @@ -89,6 +89,7 @@ profile libvirtd @sbindir@/libvirtd flags=3D(attach_disco= nnected) { /usr/lib/xen-*/bin/libxl-save-helper PUx, /usr/lib/xen-*/bin/pygrub PUx, /usr/{lib,lib64,lib/qemu,libexec}/vhost-user-gpu PUx, + /usr/{lib,lib64,lib/qemu,libexec}/virtiofsd PUx, =20 # Required by nwfilter_ebiptables_driver.c:ebiptablesWriteToTempFile() to # read and run an ebtables script. --=20 2.28.0