From patchwork Tue Oct 8 16:22:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 175523 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5922105ill; Tue, 8 Oct 2019 09:26:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwx2sR+Jqopk+3b9L18vJGht9To/X6Es9K4lK+eaHrTCl6/dHQg8qb3w/oP5GC418NHQ/Vg X-Received: by 2002:a5e:d817:: with SMTP id l23mr18464710iok.142.1570551984856; Tue, 08 Oct 2019 09:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570551984; cv=none; d=google.com; s=arc-20160816; b=MvJOHhCA0Ho0Uw5WmRh2N+bDr2DUbJ4i2dZNsa/iwVrpL5EWhjIVYRL4o0g342o7sA c7TTfC5LBP1nXEJd2y+qYE34PhmqZePxU2Y281tAFznC/EmBElDuagq25xeDoa5xWYo3 f9KJnRgJVaFy9Y1iz9Bpw7C7kfDlM0MPGRXkcrIRn13TMy5dUAQJ+SFPzf6zdM2wNTMA Rj0H5wiQzJUQCyCvIn5L+lmZEH2fTXHPd8rK8JM+0bOJp719vQfAZp8GbAK6y1qheq6k KgV84jnIeDRPk+VlLNrvQ2gFxviZnwpXf5Do52NGWdqe8zr0+QULTRIDn2viMVbe9nHZ v1Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=SPh5kmuPYrLbhMbCpubN+/KX8K/c5iWg8s9PphmwWQk=; b=Q09CXPCFBGof2y9Q9izpZzdIpJm6uzk2prcPp8FpHy08/NdeVrDXfU1CiRMq0aqHeD XNWrlo5kXgc8ySpvKlT9/7cNJM9wH08hAudp3fe5jzvGjUuCUehVaCdVlj4EoWqUCvoo yaLqV6LFa663/eMH3YVG3s9rrq05qANSe5jH8EYBrRMaVU2reCT/d8v2YH1bFT73goEi ty6rcBupfX7DjYUf1WRX6Pch4/4P0mo+PwkPJ4DTznbUxIp2MrxuB54dpNz0BMowW6pi bPCqNSBUG1lk7WFt0nFolS83aEsGt1klKhp1fgeJeUdpADtlHCs8XFHLU3cvB7+KPARm I4TA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id t1si20661596iom.89.2019.10.08.09.26.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2019 09:26:24 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A3A4D30609AF; Tue, 8 Oct 2019 16:26:23 +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 764BD60606; Tue, 8 Oct 2019 16:26:23 +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 324C54EE71; Tue, 8 Oct 2019 16:26:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x98GM2Mw008696 for ; Tue, 8 Oct 2019 12:22:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 26B0160606; Tue, 8 Oct 2019 16:22:02 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1B9960605; Tue, 8 Oct 2019 16:22:01 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 8 Oct 2019 12:22:26 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: christian.ehrhardt@canonical.com Subject: [libvirt] [PATCH 6/7] security: apparmor: Use only virStorageSource for disk paths 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 08 Oct 2019 16:26:24 +0000 (UTC) This is closer to what security_selinux.c does, and will help add support for qcow2 external data_files Signed-off-by: Cole Robinson --- src/security/virt-aa-helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 20281c38b7..b675572144 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -938,13 +938,13 @@ add_file_path(virStorageSourcePtr src, static int -disk_add_files(virDomainDiskDefPtr disk, - virBufferPtr buf) +storage_source_add_files(virStorageSourcePtr src, + virBufferPtr buf) { size_t depth = 0; virStorageSourcePtr tmp; - for (tmp = disk->src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) { + for (tmp = src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) { if (add_file_path(tmp, depth, buf) < 0) return -1; @@ -994,7 +994,7 @@ get_files(vahControl * ctl) /* XXX should handle open errors more careful than just ignoring them. */ - if (disk_add_files(disk, &buf) < 0) + if (storage_source_add_files(disk->src, &buf) < 0) goto cleanup; }