Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1838470ybh; Mon, 20 Jul 2020 08:24:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4oxMPNkhhhG0xEzUbLsELyuEXGQEFufXs0rgHcwNht/+rOtnCwpmy/322EooZfCzlsTkr X-Received: by 2002:aa7:d341:: with SMTP id m1mr21122187edr.50.1595258676152; Mon, 20 Jul 2020 08:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595258676; cv=none; d=google.com; s=arc-20160816; b=n/cjqWJGGXa0XG60rZjJ2wI3bGgVok8pDbQmUqkdJo1ELRMxk/j/bsiYHUYBIssT1A Tm9GwKXICqB+lz8/uPDQ6fMaAlipGzfY14hFe/0JGVMD2QouWvGCk3dlpLI1TD+K01CC Z3rMr4pXy5yGYaMeFsti23VT7h2iMq535RjY0d6WUOHc5FYghCMX1GTnhJrmEziOO+lu es+cxPRrgO4wZBv97vTDQBqZgkvjL6tcFpU9e0jxAYVnG1px0JLRVzATlRDnk3AB1W77 XWhxYmHDwBDKVNJ8ry+aXZ6LsdLgDyLnRxY+7SPLQajH8687RdX+diXeOtJBcWcPumxM yw2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=J74HKsE6BQB61ViBOZwKU/akj9IUtIuEcshXkxPv29w=; b=piQILdejJ9Lzn8PIo2fj8vszyQggS5tyA3T2hMbaT5rkRbbODr+jdPgj0EAKfIs8EG aF4swEIgsHltd/aqEvCS3J8Bljbq9RSmYTjQO5NIVbjrRJSOoS324UuCiwgNHUQqWSp9 c05LBfVCeybeN/+F70tiijIPk7pHkP07JI61vghpsVnQ8fn6sxaOO5PTE4kHh4JCs09e T2EbvT4nUP7OjTUpL8i0nTmlN7TxK0PtJXWOAuEcPbmHKGw4mMil1ZPdEXlPw0Qa2Pe1 mECI4rCLxWWbfRpwYpXivq0xnmQ6XRHAC6jHXuCfSmBv/nVdPFtqEZAxs0qtw7x8wgCE u5LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="VTk/w6cv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dh22si10469634edb.38.2020.07.20.08.24.13; Mon, 20 Jul 2020 08:24:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="VTk/w6cv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728543AbgGTPYB (ORCPT + 99 others); Mon, 20 Jul 2020 11:24:01 -0400 Received: from linux.microsoft.com ([13.77.154.182]:47690 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728469AbgGTPX6 (ORCPT ); Mon, 20 Jul 2020 11:23:58 -0400 Received: from prsriva-linux.hsd1.wa.comcast.net (c-24-19-135-168.hsd1.wa.comcast.net [24.19.135.168]) by linux.microsoft.com (Postfix) with ESMTPSA id C007F20B4911; Mon, 20 Jul 2020 08:23:57 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C007F20B4911 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1595258638; bh=J74HKsE6BQB61ViBOZwKU/akj9IUtIuEcshXkxPv29w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VTk/w6cv15Tx8/ktbyQ53lq9phIP4OVRmHCbmrsUVjV19MtxDhu4Z0HLaGQS3i6KJ 41OyVSqjACTGPJQNIN2Dg9Hh9KYibl2yWVECcfdIonozDXmi44D8boksPA7wva2vL+ zHacS2a7t5KqTCM+XpipvI2GTFUzIAAl8shx4gEg= From: Prakhar Srivastava To: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, robh+dt@kernel.org, frowand.list@gmail.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, pasha.tatashin@soleen.com, allison@lohutok.net, kstewart@linuxfoundation.org, takahiro.akashi@linaro.org, tglx@linutronix.de, vincenzo.frascino@arm.com, mark.rutland@arm.com, masahiroy@kernel.org, james.morse@arm.com, bhsharma@redhat.com, mbrugger@suse.com, hsinyi@chromium.org, tao.li@vivo.com, christophe.leroy@c-s.fr, gregkh@linuxfoundation.org, nramas@linux.microsoft.com, prsriva@linux.microsoft.com, tusharsu@linux.microsoft.com, balajib@linux.microsoft.com, bauerman@linux.ibm.com, robh@kernel.org Subject: [PATCH V3 6/6] Add the property used for carrying forward the IMA measurement logs and update the code to use the defined property string. Date: Mon, 20 Jul 2020 08:23:42 -0700 Message-Id: <20200720152342.337990-7-prsriva@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200720152342.337990-1-prsriva@linux.microsoft.com> References: <20200720152342.337990-1-prsriva@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Prakhar Srivastava --- arch/arm64/kernel/machine_kexec_file.c | 19 ++++++++++--------- arch/powerpc/kexec/ima.c | 8 +++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c index 066670c43626..59058901e641 100644 --- a/arch/arm64/kernel/machine_kexec_file.c +++ b/arch/arm64/kernel/machine_kexec_file.c @@ -24,14 +24,15 @@ #include /* relevant device tree properties */ -#define FDT_PROP_KEXEC_ELFHDR "linux,elfcorehdr" -#define FDT_PROP_MEM_RANGE "linux,usable-memory-range" -#define FDT_PROP_INITRD_START "linux,initrd-start" -#define FDT_PROP_INITRD_END "linux,initrd-end" -#define FDT_PROP_BOOTARGS "bootargs" -#define FDT_PROP_KASLR_SEED "kaslr-seed" -#define FDT_PROP_RNG_SEED "rng-seed" -#define RNG_SEED_SIZE 128 +#define FDT_PROP_KEXEC_ELFHDR "linux,elfcorehdr" +#define FDT_PROP_MEM_RANGE "linux,usable-memory-range" +#define FDT_PROP_INITRD_START "linux,initrd-start" +#define FDT_PROP_INITRD_END "linux,initrd-end" +#define FDT_PROP_BOOTARGS "bootargs" +#define FDT_PROP_KASLR_SEED "kaslr-seed" +#define FDT_PROP_RNG_SEED "rng-seed" +#define FDT_PROP_IMA_KEXEC_BUFFER "linux,ima-kexec-buffer" +#define RNG_SEED_SIZE 128 const struct kexec_file_ops * const kexec_file_loaders[] = { &kexec_image_ops, @@ -157,7 +158,7 @@ static int setup_dtb(struct kimage *image, if (image->arch.ima_buffer_size > 0) { ret = fdt_appendprop_addrrange(dtb, 0, off, - "linux,ima-kexec-buffer", + FDT_PROP_IMA_KEXEC_BUFFER, image->arch.ima_buffer_addr, image->arch.ima_buffer_size); if (ret) diff --git a/arch/powerpc/kexec/ima.c b/arch/powerpc/kexec/ima.c index a9e4e9f04273..7d6c43b2eacb 100644 --- a/arch/powerpc/kexec/ima.c +++ b/arch/powerpc/kexec/ima.c @@ -12,6 +12,8 @@ #include #include +#define FDT_PROP_IMA_KEXEC_BUFFER "linux,ima-kexec-buffer" + /** * remove_ima_buffer - remove the IMA buffer property and reservation from @fdt * @@ -25,7 +27,7 @@ void remove_ima_buffer(void *fdt, int chosen_node) size_t size; const void *prop; - prop = fdt_getprop(fdt, chosen_node, "linux,ima-kexec-buffer", &len); + prop = fdt_getprop(fdt, chosen_node, FDT_PROP_IMA_KEXEC_BUFFER, &len); if (!prop) return; @@ -45,7 +47,7 @@ void remove_ima_buffer(void *fdt, int chosen_node) addr = of_read_number(prop, addr_cells); size = of_read_number(prop + 4 * addr_cells, size_cells); - fdt_delprop(fdt, chosen_node, "linux,ima-kexec-buffer"); + fdt_delprop(fdt, chosen_node, FDT_PROP_IMA_KEXEC_BUFFER); if (ret) return; @@ -134,7 +136,7 @@ int setup_ima_buffer(const struct kimage *image, void *fdt, int chosen_node) if (ret) return ret; - ret = fdt_setprop(fdt, chosen_node, "linux,ima-kexec-buffer", value, + ret = fdt_setprop(fdt, chosen_node, FDT_PROP_IMA_KEXEC_BUFFER, value, entry_size); if (ret < 0) return -EINVAL; -- 2.25.1