Re: [PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-18 Thread Lakshmi Ramasubramanian
ivers/of/kexec.c") Cc: Frank Rowand Cc: Prakhar Srivastava Cc: Lakshmi Ramasubramanian Cc: Thiago Jung Bauermann Cc: Rob Herring Signed-off-by: Vaibhav Jain --- drivers/of/kexec.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c index b9

Re: [PATCH v2 1/2] powerpc: Free fdt on error in elf64_load()

2021-04-23 Thread Lakshmi Ramasubramanian
On 4/21/21 9:36 AM, Lakshmi Ramasubramanian wrote: Hi Dan, There are a few "goto out;" statements before the local variable "fdt" is initialized through the call to of_kexec_alloc_and_setup_fdt() in elf64_load(). This will result in an uninitialized "fd

[PATCH v2 2/2] powerpc: If kexec_build_elf_info() fails return immediately from elf64_load()

2021-04-21 Thread Lakshmi Ramasubramanian
Uninitialized local variable "elf_info" would be passed to kexec_free_elf_info() if kexec_build_elf_info() returns an error in elf64_load(). If kexec_build_elf_info() returns an error, return the error immediately. Signed-off-by: Lakshmi Ramasubramanian Reported-by: Dan Carpenter

[PATCH v2 1/2] powerpc: Free fdt on error in elf64_load()

2021-04-21 Thread Lakshmi Ramasubramanian
re is an error before the call to of_kexec_alloc_and_setup_fdt(). If there is any error after fdt is allocated, but before it is saved in the arch specific kimage struct, free the fdt. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Michael Ellerman Signed-off-by: Lakshmi Ramasubramanian --

Re: [PATCH 1/2] powerpc: Free fdt on error in elf64_load()

2021-04-21 Thread Lakshmi Ramasubramanian
On 4/21/21 12:18 AM, Michael Ellerman wrote: Lakshmi Ramasubramanian writes: There are a few "goto out;" statements before the local variable "fdt" is initialized through the call to of_kexec_alloc_and_setup_fdt() in elf64_load(). This will result in an uninitialize

Re: [PATCH 1/2] powerpc: Free fdt on error in elf64_load()

2021-04-21 Thread Lakshmi Ramasubramanian
t" being passed to kvfree() in this function if there is an error before the call to of_kexec_alloc_and_setup_fdt(). If there is any error after fdt is allocated, but before it is saved in the arch specific kimage struct, free the fdt. Signed-off-by: Lakshmi Ramasubramanian Reported-by: kernel test rob

[PATCH 2/2] powerpc: If kexec_build_elf_info() fails return immediately from elf64_load()

2021-04-20 Thread Lakshmi Ramasubramanian
Uninitialized local variable "elf_info" would be passed to kexec_free_elf_info() if kexec_build_elf_info() returns an error in elf64_load(). If kexec_build_elf_info() returns an error, return the error immediately. Signed-off-by: Lakshmi Ramasubramanian Reported-by: Dan Carpenter

[PATCH 1/2] powerpc: Free fdt on error in elf64_load()

2021-04-20 Thread Lakshmi Ramasubramanian
re is an error before the call to of_kexec_alloc_and_setup_fdt(). If there is any error after fdt is allocated, but before it is saved in the arch specific kimage struct, free the fdt. Signed-off-by: Lakshmi Ramasubramanian Reported-by: kernel test robot Reported-by: Dan Carpenter Suggested-by: Michael Ellerman --

Re: [PATCH] powerpc: Initialize local variable fdt to NULL in elf64_load()

2021-04-20 Thread Lakshmi Ramasubramanian
On 4/20/21 8:47 AM, Rob Herring wrote: On Tue, Apr 20, 2021 at 10:04 AM Lakshmi Ramasubramanian wrote: On 4/20/21 7:42 AM, Lakshmi Ramasubramanian wrote: On 4/20/21 6:06 AM, Rob Herring wrote: On Tue, Apr 20, 2021 at 12:20 AM Lakshmi Ramasubramanian wrote: On 4/19/21 10:00 PM, Dan

Re: [PATCH] powerpc: Initialize local variable fdt to NULL in elf64_load()

2021-04-20 Thread Lakshmi Ramasubramanian
On 4/20/21 7:42 AM, Lakshmi Ramasubramanian wrote: On 4/20/21 6:06 AM, Rob Herring wrote: On Tue, Apr 20, 2021 at 12:20 AM Lakshmi Ramasubramanian wrote: On 4/19/21 10:00 PM, Dan Carpenter wrote: On Tue, Apr 20, 2021 at 09:30:16AM +1000, Michael Ellerman wrote: Lakshmi Ramasubramanian

Re: [PATCH] powerpc: Initialize local variable fdt to NULL in elf64_load()

2021-04-20 Thread Lakshmi Ramasubramanian
On 4/20/21 6:06 AM, Rob Herring wrote: On Tue, Apr 20, 2021 at 12:20 AM Lakshmi Ramasubramanian wrote: On 4/19/21 10:00 PM, Dan Carpenter wrote: On Tue, Apr 20, 2021 at 09:30:16AM +1000, Michael Ellerman wrote: Lakshmi Ramasubramanian writes: On 4/16/21 2:05 AM, Michael Ellerman wrote

Re: [PATCH] powerpc: Initialize local variable fdt to NULL in elf64_load()

2021-04-19 Thread Lakshmi Ramasubramanian
On 4/19/21 10:00 PM, Dan Carpenter wrote: On Tue, Apr 20, 2021 at 09:30:16AM +1000, Michael Ellerman wrote: Lakshmi Ramasubramanian writes: On 4/16/21 2:05 AM, Michael Ellerman wrote: Daniel Axtens writes: On 4/15/21 12:14 PM, Lakshmi Ramasubramanian wrote: Sorry - missed copying device

Re: [PATCH] powerpc: Initialize local variable fdt to NULL in elf64_load()

2021-04-19 Thread Lakshmi Ramasubramanian
On 4/19/21 4:30 PM, Michael Ellerman wrote: Lakshmi Ramasubramanian writes: On 4/16/21 2:05 AM, Michael Ellerman wrote: Daniel Axtens writes: On 4/15/21 12:14 PM, Lakshmi Ramasubramanian wrote: Sorry - missed copying device-tree and powerpc mailing lists. There are a few "got

Re: [PATCH] powerpc: Initialize local variable fdt to NULL in elf64_load()

2021-04-16 Thread Lakshmi Ramasubramanian
On 4/16/21 2:05 AM, Michael Ellerman wrote: Daniel Axtens writes: On 4/15/21 12:14 PM, Lakshmi Ramasubramanian wrote: Sorry - missed copying device-tree and powerpc mailing lists. There are a few "goto out;" statements before the local variable "fdt" is initiali

Re: [PATCH] powerpc: Initialize local variable fdt to NULL in elf64_load()

2021-04-15 Thread Lakshmi Ramasubramanian
On 4/15/21 12:14 PM, Lakshmi Ramasubramanian wrote: Sorry - missed copying device-tree and powerpc mailing lists. There are a few "goto out;" statements before the local variable "fdt" is initialized through the call to of_kexec_alloc_and_setup_fdt() in elf64_load

Re: [PATCH v2] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-03-09 Thread Lakshmi Ramasubramanian
kernel command line and /chosen properties. Therefore change kexec_fdt_totalsize_ppc64() to calculate just the extra space needed by the kdump kernel, and change the function name so that it better reflects what the function is now doing. Signed-off-by: Thiago Jung Bauermann Reviewed-by: Lak

Re: [PATCH v19 00/13] Carry forward IMA measurement log on kexec on ARM64

2021-03-02 Thread Lakshmi Ramasubramanian
On 3/2/21 7:06 AM, Rob Herring wrote: On Sun, Feb 21, 2021 at 11:49 AM Lakshmi Ramasubramanian wrote: On kexec file load Integrity Measurement Architecture (IMA) subsystem may verify the IMA signature of the kernel and initramfs, and measure it. The command line parameters passed

Re: [PATCH v19 05/13] of: Add a common kexec FDT setup function

2021-02-23 Thread Lakshmi Ramasubramanian
On 2/23/21 5:20 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: From: Rob Herring Both arm64 and powerpc do essentially the same FDT /chosen setup for kexec. The differences are either omissions that arm64 should have or additional properties that will be ignored

Re: [PATCH v18 03/11] of: Add a common kexec FDT setup function

2021-02-21 Thread Lakshmi Ramasubramanian
On 2/21/21 5:32 PM, Guenter Roeck wrote: Hi Guenter, On Sat, Feb 13, 2021 at 08:10:41AM -0800, Lakshmi Ramasubramanian wrote: From: Rob Herring Both arm64 and powerpc do essentially the same FDT /chosen setup for kexec. The differences are either omissions that arm64 should have

[PATCH v19 13/13] arm64: Enable passing IMA log to next kernel on kexec

2021-02-21 Thread Lakshmi Ramasubramanian
Update CONFIG_KEXEC_FILE to select CONFIG_HAVE_IMA_KEXEC, if CONFIG_IMA is enabled, to indicate that the IMA measurement log information is present in the device tree for ARM64. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian

[PATCH v19 12/13] powerpc: Delete unused function delete_fdt_mem_rsv()

2021-02-21 Thread Lakshmi Ramasubramanian
Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 1 - arch/powerpc/kexec/file_load.c | 32 2 files changed, 33 deletions(-) diff --git a/arch/powerpc/include/asm/kexec.h b/ar

[PATCH v19 11/13] kexec: Use fdt_appendprop_addrrange() to add ima buffer to FDT

2021-02-21 Thread Lakshmi Ramasubramanian
e next kernel across kexec system call. Remove custom code that is used in setup_ima_buffer() to add "linux,ima-kexec-buffer" property to the device tree. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiag

[PATCH v19 10/13] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2021-02-21 Thread Lakshmi Ramasubramanian
t;arch/powerpc/kexec/ima.c" and "arch/powerpc/include/asm/ima.h". Remove references to the deleted files and functions in powerpc and in ima. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiago Jung Ba

[PATCH v19 09/13] powerpc: Enable passing IMA log to next kernel on kexec

2021-02-21 Thread Lakshmi Ramasubramanian
information is present in the device tree for powerpc. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Thiago Jung Bauermann Reviewed-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc

[PATCH v19 08/13] powerpc: Move ima buffer fields to struct kimage

2021-02-21 Thread Lakshmi Ramasubramanian
r_size in ima_add_kexec_buffer() in security/integrity/ima/ima_kexec.c. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Will Deacon Reviewed-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/ima.h | 3 --- ar

[PATCH v19 06/13] arm64: Use common of_kexec_alloc_and_setup_fdt()

2021-02-21 Thread Lakshmi Ramasubramanian
evice tree and update the memory reservation for kexec for arm64. Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiago Jung Bauermann --- arch/arm64/kernel/machine_kexec_file.c | 180 ++--- 1 file changed, 8 insertions(+), 172 deletions(-) diff --

[PATCH v19 07/13] powerpc: Use common of_kexec_alloc_and_setup_fdt()

2021-02-21 Thread Lakshmi Ramasubramanian
evice tree and update the memory reservation for kexec for powerpc. Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 1 + arch/powerpc/kexec/elf_64.c | 30 --- arch/powerpc/kexec/file_load.

[PATCH v19 05/13] of: Add a common kexec FDT setup function

2021-02-21 Thread Lakshmi Ramasubramanian
arm64, in of_kexec_alloc_and_setup_fdt() and move it to "drivers/of/kexec.c". Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian Fixes: 33488dc4d61f ("of: Add a common kexec FDT setup function") Reported-by: kernel t

[PATCH v19 02/13] arm64: Use ELF fields defined in 'struct kimage'

2021-02-21 Thread Lakshmi Ramasubramanian
ELF related fields elf_headers, elf_headers_sz, and elf_headers_mem have been moved from 'struct kimage_arch' to 'struct kimage' as elf_headers, elf_headers_sz, and elf_load_addr respectively. Use the ELF fields defined in 'struct kimage'. Signed-off-by: Lakshmi Ramasubramanian Suggested

[PATCH v19 03/13] powerpc: Use ELF fields defined in 'struct kimage'

2021-02-21 Thread Lakshmi Ramasubramanian
ELF related fields elf_headers, elf_headers_sz, and elfcorehdr_addr have been moved from 'struct kimage_arch' to 'struct kimage' as elf_headers, elf_headers_sz, and elf_load_addr respectively. Use the ELF fields defined in 'struct kimage'. Signed-off-by: Lakshmi Ramasubramanian Suggested

[PATCH v19 00/13] Carry forward IMA measurement log on kexec on ARM64

2021-02-21 Thread Lakshmi Ramasubramanian
c-buffer node in the chosen node documentation v0: Add a layer of abstraction to use the memory reserved by device tree for ima buffer pass. Add support for ima buffer pass using reserved memory for arm64 kexec. Update the arch sepcific code path in kexec file load to store the ima

[PATCH v19 01/13] kexec: Move ELF fields to struct kimage

2021-02-21 Thread Lakshmi Ramasubramanian
system call. Move the ELF fields to 'struct kimage' defined in include/linux/kexec.h so common code can use it. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Rob Herring Fixes: 33488dc4d61f ("of: Add a common kexec FDT setup function") Reported-by: kernel test robot --- inc

[PATCH v19 04/13] x86: Use ELF fields defined in 'struct kimage'

2021-02-21 Thread Lakshmi Ramasubramanian
ELF related fields elf_headers, elf_headers_sz, and elf_load_addr have been moved from 'struct kimage_arch' to 'struct kimage'. Use the ELF fields defined in 'struct kimage'. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Rob Herring Fixes: 33488dc4d61f ("of: Add a common kexec FDT

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-19 Thread Lakshmi Ramasubramanian
On 2/19/21 10:09 AM, Thiago Jung Bauermann wrote: Mimi Zohar writes: On Fri, 2021-02-19 at 11:43 -0600, Rob Herring wrote: On Fri, Feb 19, 2021 at 10:57 AM Lakshmi Ramasubramanian wrote: On 2/19/21 6:16 AM, Rob Herring wrote: On Thu, Feb 18, 2021 at 8:53 PM Lakshmi Ramasubramanian

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-19 Thread Lakshmi Ramasubramanian
On 2/19/21 6:16 AM, Rob Herring wrote: On Thu, Feb 18, 2021 at 8:53 PM Lakshmi Ramasubramanian wrote: On 2/18/21 5:13 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: On 2/18/21 4:07 PM, Mimi Zohar wrote: Hi Mimi, On Thu, 2021-02-18 at 14:33 -0800, Lakshmi

Re: [PATCH] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-02-19 Thread Lakshmi Ramasubramanian
On 2/19/21 6:25 AM, Thiago Jung Bauermann wrote: One small nit in the function header (please see below), but otherwise the change looks good. Reviewed-by: Lakshmi Ramasubramanian Commit 2377c92e37fe ("powerpc/kexec_file: fix FDT size estimation for kdump kernel") fixed how

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-18 Thread Lakshmi Ramasubramanian
On 2/18/21 5:13 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: On 2/18/21 4:07 PM, Mimi Zohar wrote: Hi Mimi, On Thu, 2021-02-18 at 14:33 -0800, Lakshmi Ramasubramanian wrote: of_kexec_alloc_and_setup_fdt() defined in drivers/of/kexec.c builds a new device tree object

Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-18 Thread Lakshmi Ramasubramanian
On 2/18/21 4:07 PM, Mimi Zohar wrote: Hi Mimi, On Thu, 2021-02-18 at 14:33 -0800, Lakshmi Ramasubramanian wrote: of_kexec_alloc_and_setup_fdt() defined in drivers/of/kexec.c builds a new device tree object that includes architecture specific data for kexec system call. This should be defined

[PATCH] of: error: 'const struct kimage' has no member named 'arch'

2021-02-18 Thread Lakshmi Ramasubramanian
ew boolean config OF_KEXEC that is enabled if CONFIG_KEXEC_FILE and CONFIG_OF_FLATTREE are enabled, and the architecture is arm64 or powerpc64. Build drivers/of/kexec.c if CONFIG_OF_KEXEC is enabled. Signed-off-by: Lakshmi Ramasubramanian Fixes: 33488dc4d61f ("of: Add a common kexec FDT

[PATCH v18 11/11] arm64: Enable passing IMA log to next kernel on kexec

2021-02-13 Thread Lakshmi Ramasubramanian
Update CONFIG_KEXEC_FILE to select CONFIG_HAVE_IMA_KEXEC, if CONFIG_IMA is enabled, to indicate that the IMA measurement log information is present in the device tree for ARM64. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian

[PATCH v18 10/11] powerpc: Delete unused function delete_fdt_mem_rsv()

2021-02-13 Thread Lakshmi Ramasubramanian
Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 1 - arch/powerpc/kexec/file_load.c | 32 2 files changed, 33 deletions(-) diff --git a/arch/powerpc/include/asm/kexec.h b/ar

[PATCH v18 09/11] kexec: Use fdt_appendprop_addrrange() to add ima buffer to FDT

2021-02-13 Thread Lakshmi Ramasubramanian
e next kernel across kexec system call. Remove custom code that is used in setup_ima_buffer() to add "linux,ima-kexec-buffer" property to the device tree. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiag

[PATCH v18 08/11] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2021-02-13 Thread Lakshmi Ramasubramanian
t;arch/powerpc/kexec/ima.c" and "arch/powerpc/include/asm/ima.h". Remove references to the deleted files and functions in powerpc and in ima. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiago Jung Ba

[PATCH v18 07/11] powerpc: Enable passing IMA log to next kernel on kexec

2021-02-13 Thread Lakshmi Ramasubramanian
information is present in the device tree for powerpc. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Thiago Jung Bauermann Reviewed-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc

[PATCH v18 05/11] powerpc: Use common of_kexec_alloc_and_setup_fdt()

2021-02-13 Thread Lakshmi Ramasubramanian
evice tree and update the memory reservation for kexec for powerpc. Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/kexec.h | 1 + arch/powerpc/kexec/elf_64.c | 30 --- arch/powerpc/kexec/file_load.c| 132 +- ar

[PATCH v18 06/11] powerpc: Move ima buffer fields to struct kimage

2021-02-13 Thread Lakshmi Ramasubramanian
r_size in ima_add_kexec_buffer() in security/integrity/ima/ima_kexec.c. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Will Deacon --- arch/powerpc/include/asm/ima.h | 3 --- arch/powerpc/include/asm/kexec.h

[PATCH v18 01/11] powerpc: Rename kexec elfcorehdr_addr to elf_load_addr

2021-02-13 Thread Lakshmi Ramasubramanian
for kexec system call. Rename elfcorehdr_addr to elf_load_addr to align with x86_64 name so common code can use it. Signed-off-by: Rob Herring Reviewed-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/kexec/file_load.c| 4 ++-- arch/powerpc/kexec

[PATCH v18 02/11] arm64: Rename kexec elf_headers_mem to elf_load_addr

2021-02-13 Thread Lakshmi Ramasubramanian
. Rename elf_headers_mem to elf_load_addr to align with powerpc name so common code can use it. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Thiago Jung Bauermann --- arch/arm64/include/asm/kexec.h | 2 +- arch/arm64/kernel/machine_kexec_file.c | 6 +++--- 2 files changed, 4

[PATCH v18 04/11] arm64: Use common of_kexec_alloc_and_setup_fdt()

2021-02-13 Thread Lakshmi Ramasubramanian
evice tree and update the memory reservation for kexec for arm64. Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian --- arch/arm64/kernel/machine_kexec_file.c | 180 ++--- 1 file changed, 8 insertions(+), 172 deletions(-) diff --git a/arch/arm64/kernel/machine_kexec

[PATCH v18 00/10] Carry forward IMA measurement log on kexec on ARM64

2021-02-13 Thread Lakshmi Ramasubramanian
. Add support for ima buffer pass using reserved memory for arm64 kexec. Update the arch sepcific code path in kexec file load to store the ima buffer in the reserved memory. The same reserved memory is read on kexec or cold boot. Lakshmi Ramasubramanian (7): arm64: Rename kexec el

[PATCH v18 03/11] of: Add a common kexec FDT setup function

2021-02-13 Thread Lakshmi Ramasubramanian
arm64, in of_kexec_alloc_and_setup_fdt() and move it to "drivers/of/kexec.c". Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian --- drivers/of/Makefile | 6 + drivers/of/kexec.c | 265 include/linux/of.h | 5 + 3

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-12 Thread Lakshmi Ramasubramanian
On 2/12/21 10:24 AM, Rob Herring wrote: On Fri, Feb 12, 2021 at 11:19 AM Lakshmi Ramasubramanian wrote: On 2/12/21 6:38 AM, Rob Herring wrote: On Thu, Feb 11, 2021 at 7:17 PM Lakshmi Ramasubramanian wrote: On 2/11/21 5:09 PM, Thiago Jung Bauermann wrote: There's actually a complication

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-12 Thread Lakshmi Ramasubramanian
On 2/12/21 6:38 AM, Rob Herring wrote: On Thu, Feb 11, 2021 at 7:17 PM Lakshmi Ramasubramanian wrote: On 2/11/21 5:09 PM, Thiago Jung Bauermann wrote: There's actually a complication that I just noticed and needs to be addressed. More below. <...> + +/* + * of_kexec_alloc_and_set

Re: Fwd: Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Lakshmi Ramasubramanian
On 2/11/21 6:11 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: On 2/11/21 3:59 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: On 2/11/21 9:42 AM, Lakshmi Ramasubramanian wrote: Hi Rob, [PATCH] powerpc: Rename kexec elfcorehdr_addr to elf_headers_mem

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Lakshmi Ramasubramanian
On 2/11/21 5:09 PM, Thiago Jung Bauermann wrote: There's actually a complication that I just noticed and needs to be addressed. More below. <...> + +/* + * of_kexec_alloc_and_setup_fdt - Alloc and setup a new Flattened Device Tree + * + * @image: kexec image being loaded. + *

Re: Fwd: Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Lakshmi Ramasubramanian
On 2/11/21 3:59 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: On 2/11/21 9:42 AM, Lakshmi Ramasubramanian wrote: Hi Rob, [PATCH] powerpc: Rename kexec elfcorehdr_addr to elf_headers_mem This change causes build problem for x86_64 architecture (please see the mail from

Re: Fwd: Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Lakshmi Ramasubramanian
On 2/11/21 9:42 AM, Lakshmi Ramasubramanian wrote: Hi Rob, [PATCH] powerpc: Rename kexec elfcorehdr_addr to elf_headers_mem This change causes build problem for x86_64 architecture (please see the mail from kernel test bot below) since arch/x86/include/asm/kexec.h uses "elf_load

Fwd: Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-11 Thread Lakshmi Ramasubramanian
tion Date: Fri, 12 Feb 2021 00:50:20 +0800 From: kernel test robot To: Lakshmi Ramasubramanian CC: kbuild-...@lists.01.org Hi Lakshmi, I love your patch! Yet something to improve: [auto build test ERROR on integrity/next-integrity] [also build test ERROR on v5.11-rc7 next-20210211] [cannot apply

Re: [PATCH v17 04/10] powerpc: Use common of_kexec_alloc_and_setup_fdt()

2021-02-10 Thread Lakshmi Ramasubramanian
On 2/10/21 5:42 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: From: Rob Herring The code for setting up the /chosen node in the device tree and updating the memory reservation for the next kernel has been moved to of_kexec_alloc_and_setup_fdt() defined in "dr

Re: [PATCH v17 00/10] Carry forward IMA measurement log on kexec on ARM64

2021-02-10 Thread Lakshmi Ramasubramanian
On 2/10/21 1:39 PM, Mimi Zohar wrote: On Wed, 2021-02-10 at 15:55 -0500, Mimi Zohar wrote: On Wed, 2021-02-10 at 14:42 -0600, Rob Herring wrote: On Wed, Feb 10, 2021 at 11:33 AM Lakshmi Ramasubramanian Ideally, we don't apply the same patch in 2 branches. It looks like there's a conflict

Re: [PATCH v17 05/10] powerpc: Move ima buffer fields to struct kimage

2021-02-10 Thread Lakshmi Ramasubramanian
On 2/10/21 9:20 AM, Rob Herring wrote: On Tue, Feb 09, 2021 at 10:21:55AM -0800, Lakshmi Ramasubramanian wrote: The fields ima_buffer_addr and ima_buffer_size in "struct kimage_arch" for powerpc are used to carry forward the IMA measurement list across kexec system call. Th

Re: [PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-10 Thread Lakshmi Ramasubramanian
On 2/10/21 9:23 AM, Rob Herring wrote: On Tue, Feb 09, 2021 at 10:21:52AM -0800, Lakshmi Ramasubramanian wrote: From: Rob Herring Both arm64 and powerpc do essentially the same FDT /chosen setup for kexec. The differences are either omissions that arm64 should have or additional properties

Re: [PATCH v17 00/10] Carry forward IMA measurement log on kexec on ARM64

2021-02-10 Thread Lakshmi Ramasubramanian
On 2/10/21 9:15 AM, Rob Herring wrote: On Tue, Feb 09, 2021 at 10:21:50AM -0800, Lakshmi Ramasubramanian wrote: On kexec file load Integrity Measurement Architecture (IMA) subsystem may verify the IMA signature of the kernel and initramfs, and measure it. The command line parameters passed

[PATCH v17 10/10] arm64: Enable passing IMA log to next kernel on kexec

2021-02-09 Thread Lakshmi Ramasubramanian
Update CONFIG_KEXEC_FILE to select CONFIG_HAVE_IMA_KEXEC, if CONFIG_IMA is enabled, to indicate that the IMA measurement log information is present in the device tree for ARM64. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian

[PATCH v17 09/10] powerpc: Delete unused function delete_fdt_mem_rsv()

2021-02-09 Thread Lakshmi Ramasubramanian
Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/kexec.h | 1 - arch/powerpc/kexec/file_load.c | 32 2 files changed, 33 deletions(-) diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h in

[PATCH v17 08/10] kexec: Use fdt_appendprop_addrrange() to add ima buffer to FDT

2021-02-09 Thread Lakshmi Ramasubramanian
e next kernel across kexec system call. Remove custom code that is used in setup_ima_buffer() to add "linux,ima-kexec-buffer" property to the device tree. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiag

[PATCH v17 07/10] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2021-02-09 Thread Lakshmi Ramasubramanian
t;arch/powerpc/kexec/ima.c" and "arch/powerpc/include/asm/ima.h". Remove references to the deleted files and functions in powerpc and in ima. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/

[PATCH v17 06/10] powerpc: Enable passing IMA log to next kernel on kexec

2021-02-09 Thread Lakshmi Ramasubramanian
information is present in the device tree for powerpc. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 107bb4319e0e

[PATCH v17 05/10] powerpc: Move ima buffer fields to struct kimage

2021-02-09 Thread Lakshmi Ramasubramanian
r() to of_ima_add_kexec_buffer() and move it in drivers/of/kexec.c. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Will Deacon --- arch/powerpc/include/asm/ima.h | 3 --- arch/powerpc/include/asm/kexec.h | 5 -

[PATCH v17 04/10] powerpc: Use common of_kexec_alloc_and_setup_fdt()

2021-02-09 Thread Lakshmi Ramasubramanian
evice tree and update the memory reservation for kexec for powerpc. Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/kexec.h | 1 + arch/powerpc/kexec/elf_64.c | 29 --- arch/powerpc/kexec/file_load.c| 132 +- ar

[PATCH v17 03/10] arm64: Use common of_kexec_alloc_and_setup_fdt()

2021-02-09 Thread Lakshmi Ramasubramanian
evice tree and update the memory reservation for kexec for arm64. Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian --- arch/arm64/kernel/machine_kexec_file.c | 180 ++--- 1 file changed, 8 insertions(+), 172 deletions(-) diff --git a/arch/arm64/kernel/machine_kexec

[PATCH v17 01/10] powerpc: Rename kexec elfcorehdr_addr to elf_headers_mem

2021-02-09 Thread Lakshmi Ramasubramanian
for kexec system call. Rename elfcorehdr_addr to elf_headers_mem to align with arm64 name so common code can use it. Signed-off-by: Rob Herring Reviewed-by: Thiago Jung Bauermann Reviewed-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/kexec/file_load.c

[PATCH v17 02/10] of: Add a common kexec FDT setup function

2021-02-09 Thread Lakshmi Ramasubramanian
arm64, in of_kexec_alloc_and_setup_fdt() and move it to "drivers/of/kexec.c". Signed-off-by: Rob Herring Signed-off-by: Lakshmi Ramasubramanian --- drivers/of/Makefile | 6 ++ drivers/of/kexec.c | 258 include/linux/of.h | 13 +++ 3

[PATCH v17 00/10] Carry forward IMA measurement log on kexec on ARM64

2021-02-09 Thread Lakshmi Ramasubramanian
node documentation v0: Add a layer of abstraction to use the memory reserved by device tree for ima buffer pass. Add support for ima buffer pass using reserved memory for arm64 kexec. Update the arch sepcific code path in kexec file load to store the ima buffer in the reserve

Re: [PATCH v2 1/2] ima: Free IMA measurement buffer on error

2021-02-05 Thread Lakshmi Ramasubramanian
On 2/5/21 9:49 AM, Mimi Zohar wrote: Hi Mimi, On Fri, 2021-02-05 at 09:39 -0800, Lakshmi Ramasubramanian wrote: On 2/5/21 2:05 AM, Greg KH wrote: On Thu, Feb 04, 2021 at 09:49:50AM -0800, Lakshmi Ramasubramanian wrote: IMA allocates kernel virtual memory to carry forward the measurement

Re: [PATCH v2 1/2] ima: Free IMA measurement buffer on error

2021-02-05 Thread Lakshmi Ramasubramanian
On 2/5/21 2:05 AM, Greg KH wrote: On Thu, Feb 04, 2021 at 09:49:50AM -0800, Lakshmi Ramasubramanian wrote: IMA allocates kernel virtual memory to carry forward the measurement list, from the current kernel to the next kernel on kexec system call, in ima_add_kexec_buffer() function. In error

Re: [PATCH v16 11/12] powerpc: Use OF alloc and free for FDT

2021-02-04 Thread Lakshmi Ramasubramanian
On 2/4/21 3:36 PM, Rob Herring wrote: On Thu, Feb 4, 2021 at 5:23 PM Lakshmi Ramasubramanian wrote: On 2/4/21 11:26 AM, Rob Herring wrote: On Thu, Feb 4, 2021 at 10:42 AM Lakshmi Ramasubramanian wrote: of_alloc_and_init_fdt() and of_free_fdt() have been defined in drivers/of/kexec.c

Re: [PATCH v16 11/12] powerpc: Use OF alloc and free for FDT

2021-02-04 Thread Lakshmi Ramasubramanian
On 2/4/21 11:26 AM, Rob Herring wrote: On Thu, Feb 4, 2021 at 10:42 AM Lakshmi Ramasubramanian wrote: of_alloc_and_init_fdt() and of_free_fdt() have been defined in drivers/of/kexec.c to allocate and free memory for FDT. Use of_alloc_and_init_fdt() and of_free_fdt() to allocate

[PATCH v2 1/2] ima: Free IMA measurement buffer on error

2021-02-04 Thread Lakshmi Ramasubramanian
list in the error code paths in ima_add_kexec_buffer() function. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Tyler Hicks Fixes: 7b8589cc29e7 ("ima: on soft reboot, save the measurement list") --- security/integrity/ima/ima_kexec.c | 1 + 1 file changed, 1 insertion(+)

[PATCH v2 2/2] ima: Free IMA measurement buffer after kexec syscall

2021-02-04 Thread Lakshmi Ramasubramanian
in "struct kimage" to store the virtual address of the buffer allocated for the IMA measurement list. Free the memory allocated for the IMA measurement list in kimage_file_post_load_cleanup() function. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Tyler Hicks Reviewed-by: Thiago Jung

[PATCH v16 11/12] powerpc: Use OF alloc and free for FDT

2021-02-04 Thread Lakshmi Ramasubramanian
kimage_arch" for powerpc to store the address of FDT, and free the memory in powerpc specific arch_kimage_file_post_load_cleanup(). Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Rob Herring Suggested-by: Thiago Jung Bauermann --- arch/powerpc/include/asm/kexec.h | 2 ++ arch/pow

[PATCH v16 12/12] arm64: Enable passing IMA log to next kernel on kexec

2021-02-04 Thread Lakshmi Ramasubramanian
Update CONFIG_KEXEC_FILE to select CONFIG_HAVE_IMA_KEXEC, if CONFIG_IMA is enabled, to indicate that the IMA measurement log information is present in the device tree for ARM64. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian

[PATCH v16 10/12] arm64: Use OF alloc and free functions for FDT

2021-02-04 Thread Lakshmi Ramasubramanian
of_alloc_and_init_fdt() and of_free_fdt() have been defined in drivers/of/kexec.c to allocate and free memory for FDT. Use of_alloc_and_init_fdt() and of_free_fdt() to allocate and initialize the FDT, and to free the FDT respectively. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Rob

[PATCH v16 08/12] powerpc: Delete unused function delete_fdt_mem_rsv()

2021-02-04 Thread Lakshmi Ramasubramanian
Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/kexec.h | 1 - arch/powerpc/kexec/file_load.c | 32 2 files changed, 33 deletions(-) diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h in

[PATCH v16 09/12] of: Define functions to allocate and free FDT

2021-02-04 Thread Lakshmi Ramasubramanian
architecures do not have to duplicate the code. Define of_alloc_and_init_fdt() and of_free_fdt() in drivers/of/kexec.c to allocate and initialize FDT, and to free the FDT buffer respectively. Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Rob Herring Suggested-by: Joe Perches --- drivers/of/kexec.c

[PATCH v16 07/12] kexec: Use fdt_appendprop_addrrange() to add ima buffer to FDT

2021-02-04 Thread Lakshmi Ramasubramanian
e next kernel across kexec system call. Remove custom code that is used in setup_ima_buffer() to add "linux,ima-kexec-buffer" property to the device tree. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Reviewed-by: Thiag

[PATCH v16 06/12] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

2021-02-04 Thread Lakshmi Ramasubramanian
t functions from "arch/powerpc/kexec/ima.c" to "drivers/of/kexec.c". Delete "arch/powerpc/kexec/ima.c" and "arch/powerpc/include/asm/ima.h". Remove references to the deleted files in powerpc and in ima. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar

[PATCH v16 05/12] powerpc: Move ima buffer fields to struct kimage

2021-02-04 Thread Lakshmi Ramasubramanian
r() to of_ima_add_kexec_buffer() and move it in drivers/of/kexec.c. Co-developed-by: Prakhar Srivastava Signed-off-by: Prakhar Srivastava Signed-off-by: Lakshmi Ramasubramanian Suggested-by: Will Deacon --- arch/powerpc/include/asm/ima.h | 3 --- arch/powerpc/include/asm/kexec.h | 5 -

[PATCH v16 04/12] powerpc: Use common of_kexec_setup_new_fdt()

2021-02-04 Thread Lakshmi Ramasubramanian
and update the memory reservation for kexec for powerpc. Signed-off-by: Rob Herring Reviewed-by: Thiago Jung Bauermann Reviewed-by: Lakshmi Ramasubramanian --- arch/powerpc/kexec/file_load.c | 125 ++--- 1 file changed, 6 insertions(+), 119 deletions(-) diff --git a/arch/pow

[PATCH v16 03/12] arm64: Use common of_kexec_setup_new_fdt()

2021-02-04 Thread Lakshmi Ramasubramanian
and update the memory reservation for kexec for arm64. Signed-off-by: Rob Herring Reviewed-by: Thiago Jung Bauermann Reviewed-by: Lakshmi Ramasubramanian Acked-by: Will Deacon --- arch/arm64/kernel/machine_kexec_file.c | 123 + 1 file changed, 3 insertions(+), 120 deletions(-)

[PATCH v16 00/12] Carry forward IMA measurement log on kexec on ARM64

2021-02-04 Thread Lakshmi Ramasubramanian
ss using reserved memory for arm64 kexec. Update the arch sepcific code path in kexec file load to store the ima buffer in the reserved memory. The same reserved memory is read on kexec or cold boot. Lakshmi Ramasubramanian (8): powerpc: Move ima buffer fields to struct kimage p

[PATCH v16 01/12] powerpc: Rename kexec elfcorehdr_addr to elf_headers_mem

2021-02-04 Thread Lakshmi Ramasubramanian
for kexec system call. Rename elfcorehdr_addr to elf_headers_mem to align with arm64 name so common code can use it. Signed-off-by: Rob Herring Reviewed-by: Thiago Jung Bauermann Reviewed-by: Lakshmi Ramasubramanian --- arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/kexec/file_load.c

[PATCH v16 02/12] of: Add a common kexec FDT setup function

2021-02-04 Thread Lakshmi Ramasubramanian
pc and arm64, in of_kexec_setup_new_fdt() and move it to "drivers/of/kexec.c". Signed-off-by: Rob Herring Reviewed-by: Thiago Jung Bauermann Reviewed-by: Lakshmi Ramasubramanian --- drivers/of/Makefile | 1 + drivers/of/kexec.c | 236

Re: [PATCH 1/2] ima: Free IMA measurement buffer on error

2021-02-03 Thread Lakshmi Ramasubramanian
On 1/22/21 2:30 PM, Thiago Jung Bauermann wrote: Hi Lakshmi, Lakshmi Ramasubramanian writes: IMA allocates kernel virtual memory to carry forward the measurement list, from the current kernel to the next kernel on kexec system call, in ima_add_kexec_buffer() function. In error code paths

Re: [PATCH 2/2] ima: Free IMA measurement buffer after kexec syscall

2021-02-03 Thread Lakshmi Ramasubramanian
On 1/22/21 2:31 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: IMA allocates kernel virtual memory to carry forward the measurement list, from the current kernel to the next kernel on kexec system call, in ima_add_kexec_buffer() function. This buffer is not freed before

Re: [PATCH v15 09/10] arm64: Call kmalloc() to allocate DTB buffer

2021-01-27 Thread Lakshmi Ramasubramanian
On 1/27/21 8:14 PM, Thiago Jung Bauermann wrote: Lakshmi Ramasubramanian writes: On 1/27/21 7:52 PM, Thiago Jung Bauermann wrote: Will Deacon writes: On Wed, Jan 27, 2021 at 09:59:38AM -0800, Lakshmi Ramasubramanian wrote: On 1/27/21 8:52 AM, Will Deacon wrote: Hi Will, On Fri, Jan

Re: [PATCH v15 10/10] arm64: Add IMA log information in kimage used for kexec

2021-01-27 Thread Lakshmi Ramasubramanian
On 1/27/21 3:13 PM, Will Deacon wrote: On Wed, Jan 27, 2021 at 01:31:02PM -0500, Mimi Zohar wrote: On Wed, 2021-01-27 at 10:24 -0800, Lakshmi Ramasubramanian wrote: On 1/27/21 10:02 AM, Will Deacon wrote: On Wed, Jan 27, 2021 at 09:56:53AM -0800, Lakshmi Ramasubramanian wrote: On 1/27/21 8

Re: [PATCH v15 09/10] arm64: Call kmalloc() to allocate DTB buffer

2021-01-27 Thread Lakshmi Ramasubramanian
On 1/27/21 7:52 PM, Thiago Jung Bauermann wrote: Will Deacon writes: On Wed, Jan 27, 2021 at 09:59:38AM -0800, Lakshmi Ramasubramanian wrote: On 1/27/21 8:52 AM, Will Deacon wrote: Hi Will, On Fri, Jan 15, 2021 at 09:30:16AM -0800, Lakshmi Ramasubramanian wrote: create_dtb() function

Re: [PATCH v15 10/10] arm64: Add IMA log information in kimage used for kexec

2021-01-27 Thread Lakshmi Ramasubramanian
On 1/27/21 10:02 AM, Will Deacon wrote: On Wed, Jan 27, 2021 at 09:56:53AM -0800, Lakshmi Ramasubramanian wrote: On 1/27/21 8:54 AM, Will Deacon wrote: On Fri, Jan 15, 2021 at 09:30:17AM -0800, Lakshmi Ramasubramanian wrote: Address and size of the buffer containing the IMA measurement log

Re: [PATCH v15 10/10] arm64: Add IMA log information in kimage used for kexec

2021-01-27 Thread Lakshmi Ramasubramanian
On 1/27/21 8:54 AM, Will Deacon wrote: Hi Will, On Fri, Jan 15, 2021 at 09:30:17AM -0800, Lakshmi Ramasubramanian wrote: Address and size of the buffer containing the IMA measurement log need to be passed from the current kernel to the next kernel on kexec. Add address and size fields

  1   2   >