[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200720152342.337990-7-prsriva@linux.microsoft.com>
Date: Mon, 20 Jul 2020 08:23:42 -0700
From: Prakhar Srivastava <prsriva@...ux.microsoft.com>
To: linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org
Cc: catalin.marinas@....com, will@...nel.org, mpe@...erman.id.au,
benh@...nel.crashing.org, paulus@...ba.org, robh+dt@...nel.org,
frowand.list@...il.com, zohar@...ux.ibm.com,
dmitry.kasatkin@...il.com, jmorris@...ei.org, serge@...lyn.com,
pasha.tatashin@...een.com, allison@...utok.net,
kstewart@...uxfoundation.org, takahiro.akashi@...aro.org,
tglx@...utronix.de, vincenzo.frascino@....com,
mark.rutland@....com, masahiroy@...nel.org, james.morse@....com,
bhsharma@...hat.com, mbrugger@...e.com, hsinyi@...omium.org,
tao.li@...o.com, christophe.leroy@....fr,
gregkh@...uxfoundation.org, nramas@...ux.microsoft.com,
prsriva@...ux.microsoft.com, tusharsu@...ux.microsoft.com,
balajib@...ux.microsoft.com, bauerman@...ux.ibm.com,
robh@...nel.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.
Signed-off-by: Prakhar Srivastava <prsriva@...ux.microsoft.com>
---
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 <asm/byteorder.h>
/* 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 <linux/memblock.h>
#include <linux/libfdt.h>
+#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
Powered by blists - more mailing lists