From nobody Mon Apr 29 13:40:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=canonical.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1580368977528499.1362881101037; Wed, 29 Jan 2020 23:22:57 -0800 (PST) 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-197-l9DWp6PhNmGSuSqEaWwFHQ-1; Thu, 30 Jan 2020 02:22:54 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F6A113E2; Thu, 30 Jan 2020 07:22:48 +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 3142219E9C; Thu, 30 Jan 2020 07:22:47 +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 80B0B18089CD; Thu, 30 Jan 2020 07:22:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00U7LYmQ007335 for ; Thu, 30 Jan 2020 02:21:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id 91AE62166B29; Thu, 30 Jan 2020 07:21:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DC4F2166B27 for ; Thu, 30 Jan 2020 07:21:32 +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 BC31A185AB80 for ; Thu, 30 Jan 2020 07:21:32 +0000 (UTC) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-pig_jy6DNfeGfZVzEvuX9A-1; Thu, 30 Jan 2020 02:21:30 -0500 Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ix48m-0005yZ-BI; Thu, 30 Jan 2020 07:21:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580368976; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=prARxyivjpYSjR6DXPoD9LWpunAuQNToirp3Mlow0bU=; b=ct5XeUGgbvDG5CFFSzNgQYMpby85F2g3JZ/Z+bVNPJP/EprjkmUFDltXDjAfNpHIssquEs e6OCqrhuSSdPX1JkvHiws62prWE6vWjR2G8QIKiXvFXUoX1S9LblHxAos9jAE4ZS1cOksb vtCRKpqGHWXZGyyzQl0gEp5cPgjIma8= From: Christian Ehrhardt To: libvir-list@redhat.com Subject: [PATCH] apparmor: fix qemu_bridge_helper for named profile Date: Thu, 30 Jan 2020 08:21:26 +0100 Message-Id: <20200130072126.27131-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 X-MC-Unique: pig_jy6DNfeGfZVzEvuX9A-1 X-MC-Unique: l9DWp6PhNmGSuSqEaWwFHQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00U7LYmQ007335 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Guido=20G=C3=BCnther?= , 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.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Since a3ab6d42 "apparmor: convert libvirtd profile to a named profile" the detection of the subelement for qemu_bridge_helper is wrong. In combination with the older 123cc3e1 "apparmor: allow /usr/lib/qemu/qemu-bridge-helper" it now detects qemu-bridge-helper no more with its path, but instead as a proper subelement of the named profile like: label=3Dlibvirtd//qemu_bridge_helper In the same fashion the reverse rule in the qemu_bridge_helper sub-profile still uses the path and not the named profile label. Triggering denies like: apparmor=3D"DENIED" operation=3D"file_inherit" profile=3D"libvirtd//qemu_bridge_helper" pid=3D5629 comm=3D"qemu-bridge-h= el" family=3D"unix" sock_type=3D"stream" protocol=3D0 requested_mask=3D"send = receive" denied_mask=3D"send receive" addr=3Dnone peer_addr=3Dnone peer=3D"libvirt= d" This patch fixes the unix socket rules for the communication between libvirtd and qemu-bridge-helper to match that. Fixes: a3ab6d42d825499af44b8f19f9299e150d9687bc Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1655111 Signed-off-by: Christian Ehrhardt Reviewed-by: Michal Privoznik --- src/security/apparmor/usr.sbin.libvirtd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/security/apparmor/usr.sbin.libvirtd b/src/security/apparmo= r/usr.sbin.libvirtd index 29f9936ad9..172972e525 100644 --- a/src/security/apparmor/usr.sbin.libvirtd +++ b/src/security/apparmor/usr.sbin.libvirtd @@ -62,8 +62,8 @@ profile libvirtd /usr/sbin/libvirtd flags=3D(attach_disco= nnected) { signal (send) set=3D("kill", "term") peer=3Dunconfined, =20 # For communication/control to qemu-bridge-helper - unix (send, receive) type=3Dstream addr=3Dnone peer=3D(label=3D/usr/sbin= /libvirtd//qemu_bridge_helper), - signal (send) set=3D("term") peer=3D/usr/sbin/libvirtd//qemu_bridge_help= er, + unix (send, receive) type=3Dstream addr=3Dnone peer=3D(label=3Dlibvirtd/= /qemu_bridge_helper), + signal (send) set=3D("term") peer=3Dlibvirtd//qemu_bridge_helper, =20 # allow connect with openGraphicsFD, direction reversed in newer versions unix (send, receive) type=3Dstream addr=3Dnone peer=3D(label=3Dlibvirt-[= 0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*), @@ -121,7 +121,7 @@ profile libvirtd /usr/sbin/libvirtd flags=3D(attach_dis= connected) { network inet stream, =20 # For communication/control from libvirtd - unix (send, receive) type=3Dstream addr=3Dnone peer=3D(label=3D/usr/sbi= n/libvirtd), + unix (send, receive) type=3Dstream addr=3Dnone peer=3D(label=3Dlibvirtd= ), signal (receive) set=3D("term") peer=3D/usr/sbin/libvirtd, signal (receive) set=3D("term") peer=3Dlibvirtd, =20 --=20 2.25.0