From nobody Thu May 2 21:00:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1598363324; cv=none; d=zohomail.com; s=zohoarc; b=mlMokO15uibBo1acU2ShAIY5hdEopW3AchIcMcYucbgUUhcpYZ8GjlWeLn1mdPFveaz2X12A5gQz5DqnBo0KZ1z2mcmqKQLgqlLlZb8NYQq7CdAD2z2fU2sHVKnTz/IqoZbdW4YqIs2k7nX17DXrLkc2zWIzrndJLdgwa7mG02w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598363324; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lX3BGgFlTVCAPWtnbykauNzGvTTvuzAOJ8Hs5ZXndF8=; b=CXBpnwZiHWLnGeBkQ8LhiNxQf/fix60XEhmZGpBSliO5xCkubgBkTFZA+9N8gCdAqK/LaswliWqiA42e3P7fLBfvLN742iKOsybP5/IIazaLn0YcUfBggv1WXRlpBUpEbPjuH21G7/ce0BHfxQ3c5DK/CaLYuj1ooCs7PauBv7U= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1598363324293496.7492898366381; Tue, 25 Aug 2020 06:48:44 -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-497-wR-4M7EBOvGx66cp7yOG-A-1; Tue, 25 Aug 2020 09:48:41 -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 1C6D9801AEA; Tue, 25 Aug 2020 13:48:35 +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 9391A19D6C; Tue, 25 Aug 2020 13:48:34 +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 6407F1826D2F; Tue, 25 Aug 2020 13:48:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07PDVtx1003502 for ; Tue, 25 Aug 2020 09:31:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1F664ADF7D; Tue, 25 Aug 2020 13:31:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 67580B34E8 for ; Tue, 25 Aug 2020 13:31:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 13A0C8007D6 for ; Tue, 25 Aug 2020 13:31:34 +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-499-JdeHjsptMNCiEeLrVMVBnA-1; Tue, 25 Aug 2020 09:31:31 -0400 Received: from kevinlocke.name (2600-6c67-5080-46fc-48be-e124-364c-55f6.res6.spectrum.com [IPv6:2600:6c67:5080:46fc:48be:e124:364c:55f6]) (Authenticated sender: kevin@kevinlocke.name) by vulcan.kevinlocke.name (Postfix) with ESMTPSA id EF80D1BB13F8; Tue, 25 Aug 2020 13:31:29 +0000 (UTC) Received: by kevinlocke.name (Postfix, from userid 1000) id 8081A13004CD; Tue, 25 Aug 2020 07:31:27 -0600 (MDT) X-MC-Unique: wR-4M7EBOvGx66cp7yOG-A-1 X-MC-Unique: JdeHjsptMNCiEeLrVMVBnA-1 From: Kevin Locke To: libvir-list@redhat.com Subject: [PATCH v2] apparmor: allow libvirtd to call virtiofsd Date: Tue, 25 Aug 2020 07:31:27 -0600 Message-Id: In-Reply-To: References: 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.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 07PDVtx1003502 X-loop: libvir-list@redhat.com Cc: Jamie Strandboge , 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 (as a single line, wrapped below): libvirt: error : cannot execute binary /usr/lib/qemu/virtiofsd: Permission denied dmesg contains (as a single line, wrapped below): audit: type=3D1400 audit(1598229295.959:73): apparmor=3D"DENIED" operation=3D"exec" profile=3D"libvirtd" name=3D"/usr/lib/qemu/virtiofsd" pid=3D46007 comm=3D"rpc-worker" requested_mask=3D"x" denied_mask=3D"x" fsuid=3D0 ouid=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 --- Changes in v2: - Wrap log and dmesg messages, as requested 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