From nobody Sat May 4 14:20:34 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1569247089; cv=none; d=zoho.com; s=zohoarc; b=IMqp0tUisabDDKwTAnENsakRZRlwhzXR2Uy6jwoRes3/dgzWGCZJt/0cmnqmOaLPzTxQ9XIMcxZTFtU4O/2lL4jTRuGOE0VoRufpWVbH05/wu+/8Kxv7MarGuakItS9dWUmUfT1WygQ1zvJkt1fv51S6DdXAZ3StpE+JfoAsue0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247089; 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:ARC-Authentication-Results; bh=Aj0c2usrKSgn4pfk98XpMQcKsGyxzt6mbZ17+tgogM0=; b=NC5b6jTjcQ6eL85B7HKM6Ss1iivAzrXyYYJdnhBOSuxFNQyL2qO5jwMTPpZRmhgrreE5BFu4IoHlXgIMxAtLklV73FwHyFKo3bxo7QRtvRXHWrU/BREg6svmB44jItNPPAjXBJMdu5UMjMR32W6UV0GAkeNm9J5ZHyTaD/AJ13c= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569247089577468.9290210443655; Mon, 23 Sep 2019 06:58:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3511A7BDA7; Mon, 23 Sep 2019 13:58:08 +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 021265D9E2; Mon, 23 Sep 2019 13:58:08 +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 A771D4EE68; Mon, 23 Sep 2019 13:58:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8NDqRNZ006081 for ; Mon, 23 Sep 2019 09:52:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id C1F885D784; Mon, 23 Sep 2019 13:52:27 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 649745D71C; Mon, 23 Sep 2019 13:52:21 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 15:52:20 +0200 Message-Id: <4ce1d064df9d29720e735aa95272a34fc929f130.1569246582.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: libvirt-security@redhat.com Subject: [libvirt] [PATCH] qemu: snapshot: Do ACL check prior to checkpoint interlocking 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: , 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 23 Sep 2019 13:58:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Commit 7efe930ec3c introduced interlock of snapshots and checkpoints, but the check is executed prior to the snapshot API ACL check. This means that an unauthorized user can see whether a VM exists if it has a checkpoint. Move the checks to proper places. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- Given that currently checkpoints by themselves are not very useful I doubt that there are users which could hit this. Thus I'm sending it also directly to the public mailing list for faster turnaround. src/qemu/qemu_driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0753904472..f7f059b6d6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15902,18 +15902,18 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, if (!(vm =3D qemuDomObjFromDomain(domain))) goto cleanup; - if (virDomainListCheckpoints(vm->checkpoints, NULL, domain, NULL, 0) >= 0) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot create snapshot while checkpoint exists")= ); - goto cleanup; - } - priv =3D vm->privateData; cfg =3D virQEMUDriverGetConfig(driver); if (virDomainSnapshotCreateXMLEnsureACL(domain->conn, vm->def, flags) = < 0) goto cleanup; + if (virDomainListCheckpoints(vm->checkpoints, NULL, domain, NULL, 0) >= 0) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cannot create snapshot while checkpoint exists")= ); + goto cleanup; + } + if (!(caps =3D virQEMUDriverGetCapabilities(driver, false))) goto cleanup; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list