From nobody Tue May 7 02:19:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=canonical.com ARC-Seal: i=1; a=rsa-sha256; t=1584089802; cv=none; d=zohomail.com; s=zohoarc; b=Iycpoh7+laSl+GKsvmbq0N8oGEwL0vo9UOWgqWY0AZOvATVPKnPEuK0SX+gNLPV9Rn1mUJmNqSNkNhvkNLB/s+T05dCrHVuQ6hgOKZ60ad4e6B8/3VPGJddjtU5zai/w6z9EJ1ziTJLYUk3uDs9Oj/hQCjxdHAv0JRQbIrSYLNg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584089802; 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=n5ZkDK3mF77S9TBVpcXWlSNvYS3tPYEJfd7l1Zpwrgc=; b=XSaBV/HV5W3hy62k3iRTB2p81+AWBpwo0U1nXJfI86mVikbcBkyUNVSj+VJ9xkdFs90UyjmOqf89CHKfYHwoPhHGVUCPL7kqju4tHyFJPSiVRrq5P7RmU+YaAQeb5Wslp8vugzspf5Ii3oHaHyKnoHyLReIpuFx2W3DPLIXfcGE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1584089802505221.65909128693954; Fri, 13 Mar 2020 01:56:42 -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-28-Xc0C5nyjNh29UhQnzpzDFg-1; Fri, 13 Mar 2020 04:56:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07672100550D; Fri, 13 Mar 2020 08:56:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB4D660C63; Fri, 13 Mar 2020 08:56:30 +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 3BE4B85EE6; Fri, 13 Mar 2020 08:56:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02D8uOuE026818 for ; Fri, 13 Mar 2020 04:56:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id B9C85104FA50; Fri, 13 Mar 2020 08:56:24 +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 B55E4104FA4C for ; Fri, 13 Mar 2020 08:56:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 DE2B380030B for ; Fri, 13 Mar 2020 08:56:21 +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-138-niSJWOmkPpa1atiAF_82pg-1; Fri, 13 Mar 2020 04:56:19 -0400 Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jCg77-0008IL-TY; Fri, 13 Mar 2020 08:56:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584089801; 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=n5ZkDK3mF77S9TBVpcXWlSNvYS3tPYEJfd7l1Zpwrgc=; b=JZC6LtC/CvFrs/X+idUz9ouXYizVFFE/8wEh97Gvr4T3RUEK5rQqUxsS/SDip0ZAMlT15J v33NK/9kr+PHb1Cn5zT0Dy5K4yQMHgl/IRNPxA49nqKRw5bfxF4yvDKcu05AeJ50h0bQPO uMEcOkNZmKGsb9pPVh1oupCZPgXh+KE= X-MC-Unique: Xc0C5nyjNh29UhQnzpzDFg-1 X-MC-Unique: niSJWOmkPpa1atiAF_82pg-1 From: Christian Ehrhardt To: libvir-list@redhat.com Subject: [PATCH] apparmor: qemu load old shared objects Date: Fri, 13 Mar 2020 09:56:12 +0100 Message-Id: <20200313085612.23902-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02D8uOuE026818 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.12 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" On qemu upgrades the old .so files usually are replaced. But on the other hand since a qemu process represents a guest instance it is usually kept around. That makes late addition of dynamic features e.g. 'hot-attach of a ceph disk' fail by trying to load a new version of e.f. block-rbd.so into an old still running qemu binary. Qemu adds a fallback to also load modules from a versioned directory in the temporary /var/run path. That way qemu is providing a way for packaging to store modules of an upgraded qemu package as needed until the next reboo= t. This change is allowing the qemu process access to these paths. Background: This is a continuation of a discussion at KVM Forum 2019 eventually becoming [1] and recently this change is queued to get into qemu properly [= 2]. [1]: https://lists.gnu.org/archive/html/qemu-devel/2019-11/msg00005.html [2]: https://lists.nongnu.org/archive/html/qemu-devel/2020-03/msg03313.html Signed-off-by: Christian Ehrhardt Reviewed-by: Daniel P. Berrang=C3=A9 --- src/security/apparmor/libvirt-qemu | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/security/apparmor/libvirt-qemu b/src/security/apparmor/lib= virt-qemu index 80986aec61..22415c9dfd 100644 --- a/src/security/apparmor/libvirt-qemu +++ b/src/security/apparmor/libvirt-qemu @@ -164,6 +164,11 @@ /usr/{lib,lib64}/qemu/*.so mr, /usr/lib/@{multiarch}/qemu/*.so mr, =20 + # let qemu load old shared objects after upgrades (LP: #1847361) + /{var/,}run/qemu/*/*.so mr, + # but explicitly deny with auditing writing to these files + audit deny /{var/,}run/qemu/*/*.so w, + # swtpm /{usr/,}bin/swtpm rmix, /usr/{lib,lib64}/libswtpm_libtpms.so mr, --=20 2.25.1