[RESEND PATCH v3 3/3] arm64: kexec_file: use more system keyrings to verify kernel image signature

2022-03-03 Thread Coiby Xu
From: Coiby Xu This allows to verify arm64 kernel image signature using not only .builtin_trusted_keys but also .secondary_trusted_keys and .platform keyring. Acked-by: Will Deacon Signed-off-by: Coiby Xu --- arch/arm64/kernel/kexec_image.c | 4 +--- 1 file changed, 1 insertion(+), 3

[RESEND PATCH v3 1/3] kexec: clean up arch_kexec_kernel_verify_sig

2022-03-03 Thread Coiby Xu
From: Coiby Xu commit 9ec4ecef0af7790551109283ca039a7c52de343c ("kexec_file,x86, powerpc: factor out kexec_file_ops functions" allows implementing the arch-specific implementation of kernel image verification in kexec_file_ops->verify_sig. Currently, there is no arch-specific implementation of

[RESEND PATCH v3 0/3] use more system keyrings to verify arm64 kdump kernel image signature

2022-03-03 Thread Coiby Xu
This patch set allows arm64 to use more system keyrings to verify kdump kernel image signature by making the existing code in x64 public. v3: - s/arch_kexec_kernel_verify_pe_sig/kexec_kernel_verify_pe_sig [Eric] - clean up arch_kexec_kernel_verify_sig [Eric] v2: - only x86_64 and arm64 need

[RESEND PATCH v3 2/3] kexec, KEYS: make the code in bzImage64_verify_sig generic

2022-03-03 Thread Coiby Xu
From: Coiby Xu The code in bzImage64_verify_sig could make use of system keyrings including .buitin_trusted_keys, .secondary_trusted_keys and .platform keyring to verify signed kernel image as PE file. Make it generic so both x86_64 and arm64 can use it. Signed-off-by: Coiby Xu ---

[PATCH v5 6/8] kexec: exclude hot remove cpu from elfcorehdr notes

2022-03-03 Thread Eric DeVolder
Due to use of CPUHP_AP_ONLINE_DYN, upon CPU unplug, the CPU is still in the for_each_present_cpu() list when within the crash_hotplug_handler(). Thus the CPU must be explicitly excluded when building the new list of CPUs. This change identifies in crash_hotplug_handler() the CPU to be excluded,

[PATCH v5 8/8] x86/crash: Add x86 crash hotplug support for kexec_load

2022-03-03 Thread Eric DeVolder
For kexec_file_load support, the loading of the crash kernel occurs entirely within the kernel, and as such the elfcorehdr is readily identified (so that it can be modified upon hotplug events). This change enables support for kexec_load by identifying the elfcorehdr segment in the

[PATCH v5 4/8] crash: generic crash hotplug support infrastructure

2022-03-03 Thread Eric DeVolder
This patch introduces a generic crash hot plug/unplug infrastructure for CPU and memory changes. Upon CPU and memory changes, a generic crash_hotplug_handler() obtains the appropriate lock, does some important house keeping and then dispatches the hot plug/unplug event to the architecture specific

[PATCH v5 7/8] x86/crash: Add x86 crash hotplug support for kexec_file_load

2022-03-03 Thread Eric DeVolder
For x86_64, when CPU or memory is hot un/plugged, the crash elfcorehdr, which describes the CPUs and memory in the system, must also be updated. To update the elfcorehdr for x86_64, a new elfcorehdr must be generated from the available CPUs and memory. The new elfcorehdr is prepared into a

[PATCH v5 5/8] kexec: exclude elfcorehdr from the segment digest

2022-03-03 Thread Eric DeVolder
When a crash kernel is loaded via the kexec_file_load syscall, the kernel places the various segments (ie crash kernel, crash initrd, boot_params, elfcorehdr, purgatory, etc) in memory. For those architectures that utilize purgatory, a hash digest of the segments is calculated for integrity

[PATCH v5 2/8] x86/crash hp: Introduce CRASH_HOTPLUG configuration options

2022-03-03 Thread Eric DeVolder
Support for CPU and memory hotplug for crash is controlled by the CRASH_HOTPLUG configuration option, introduced by this patch. The CRASH_HOTPLUG_ELFCOREHDR_SZ related configuration option is also introduced with this patch. Signed-off-by: Eric DeVolder --- arch/x86/Kconfig | 26

[PATCH v5 3/8] crash: prototype change for crash_prepare_elf64_headers

2022-03-03 Thread Eric DeVolder
>From within crash_prepare_elf64_headers() there is a need to reference the struct kimage hotplug members. As such, this change passes the struct kimage as a parameter to the crash_prepare_elf64_headers(). This is preparation for later patch, no functionality change. Signed-off-by: Eric DeVolder

[PATCH v5 1/8] x86/crash: fix minor typo/bug in debug message

2022-03-03 Thread Eric DeVolder
The pr_debug() intends to display the memsz member, but the parameter is actually the bufsz member (which is already displayed). Correct this to display memsz value. Signed-off-by: Eric DeVolder Acked-by: Baoquan He --- arch/x86/kernel/crash.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v5 0/8] crash: Kernel handling of CPU and memory hot un/plug

2022-03-03 Thread Eric DeVolder
When the kdump service is loaded, if a CPU or memory is hot un/plugged, the crash elfcorehdr (for x86), which describes the CPUs and memory in the system, must also be updated, else the resulting vmcore is inaccurate (eg. missing either CPU context or memory regions). The current solution

Re: [PATCH v4 02/10] crash hp: Introduce CRASH_HOTPLUG configuration options

2022-03-03 Thread Eric DeVolder
On 3/3/22 06:08, Baoquan He wrote: On 03/03/22 at 12:36pm, David Hildenbrand wrote: On 03.03.22 11:22, Baoquan He wrote: On 03/02/22 at 10:20am, David Hildenbrand wrote: On 01.03.22 21:04, Eric DeVolder wrote: On 2/22/22 21:25, Baoquan He wrote: On 02/09/22 at 02:56pm, Eric DeVolder

Re: [PATCH v4 02/10] crash hp: Introduce CRASH_HOTPLUG configuration options

2022-03-03 Thread Baoquan He
On 03/03/22 at 12:36pm, David Hildenbrand wrote: > On 03.03.22 11:22, Baoquan He wrote: > > On 03/02/22 at 10:20am, David Hildenbrand wrote: > >> On 01.03.22 21:04, Eric DeVolder wrote: > >>> > >>> > >>> On 2/22/22 21:25, Baoquan He wrote: > On 02/09/22 at 02:56pm, Eric DeVolder wrote: >

Re: [PATCH v4 02/10] crash hp: Introduce CRASH_HOTPLUG configuration options

2022-03-03 Thread David Hildenbrand
On 03.03.22 11:22, Baoquan He wrote: > On 03/02/22 at 10:20am, David Hildenbrand wrote: >> On 01.03.22 21:04, Eric DeVolder wrote: >>> >>> >>> On 2/22/22 21:25, Baoquan He wrote: On 02/09/22 at 02:56pm, Eric DeVolder wrote: > Support for CPU and memory hotplug for crash is controlled by

Re: [PATCH v4 09/10] crash hp: Add x86 crash hotplug support for kexec_file_load

2022-03-03 Thread Baoquan He
On 03/01/22 at 02:12pm, Eric DeVolder wrote: > > > On 2/22/22 22:10, Baoquan He wrote: > > On 02/09/22 at 02:57pm, Eric DeVolder wrote: > > > For x86_64, when CPU or memory is hot un/plugged, the crash > > > elfcorehdr, which describes the CPUs and memory in the system, > > > must also be

Re: [PATCH v4 02/10] crash hp: Introduce CRASH_HOTPLUG configuration options

2022-03-03 Thread Baoquan He
On 03/02/22 at 10:20am, David Hildenbrand wrote: > On 01.03.22 21:04, Eric DeVolder wrote: > > > > > > On 2/22/22 21:25, Baoquan He wrote: > >> On 02/09/22 at 02:56pm, Eric DeVolder wrote: > >>> Support for CPU and memory hotplug for crash is controlled by the > >>> CRASH_HOTPLUG configuration