From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D817CC41513 for ; Mon, 7 Aug 2023 16:38:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbjHGQib (ORCPT ); Mon, 7 Aug 2023 12:38:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231944AbjHGQiM (ORCPT ); Mon, 7 Aug 2023 12:38:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D475A171E for ; Mon, 7 Aug 2023 09:37:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1920E61F5F for ; Mon, 7 Aug 2023 16:37:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 693CAC433C7; Mon, 7 Aug 2023 16:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1691426256; bh=DnG+u16KcY3rZ3rPmEEr0Mi4zi/1gfOKEUPJIB+tKnI=; h=Date:To:From:Subject:From; b=poQ0y0u3fy9pJBfeoUXGouE1T+PbX5Sv8Hw145F1iDakaAEWckZpEpdZ1F++nj4rK RHLNVdpNQYhiyGc/jqn7EKMsyYwNWmMhS0EDFaVhhh09oCIpCpxoWKEzWV0S2S4U66 vtMByl/3A2cU2fNiZyifH7mSF3BtST/yKVyTxGtE= Date: Mon, 07 Aug 2023 09:37:35 -0700 To: mm-commits@vger.kernel.org, zohar@linux.ibm.com, vschneid@redhat.com, vgoyal@redhat.com, vbabka@suse.cz, tiwai@suse.de, tglx@linutronix.de, sourabhjain@linux.ibm.com, seanjc@google.com, rafael@kernel.org, osalvador@suse.de, naveen.n.rao@linux.vnet.ibm.com, mingo@redhat.com, linux@weissschuh.net, lf32.dev@gmail.com, konrad.wilk@oracle.com, hpa@zytor.com, hbathini@linux.ibm.com, gregkh@linuxfoundation.org, ebiederm@xmission.com, dyoung@redhat.com, david@redhat.com, dave.hansen@linux.intel.com, corbet@lwn.net, bp@alien8.de, boris.ostrovsky@oracle.com, bhe@redhat.com, bhelgaas@google.com, eric.devolder@oracle.com, akpm@linux-foundation.org From: Andrew Morton Subject: + kexec-exclude-elfcorehdr-from-the-segment-digest.patch added to mm-nonmm-unstable branch Message-Id: <20230807163736.693CAC433C7@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: kexec: exclude elfcorehdr from the segment digest has been added to the -mm mm-nonmm-unstable branch. Its filename is kexec-exclude-elfcorehdr-from-the-segment-digest.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kexec-exclude-elfcorehdr-from-the-segment-digest.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Eric DeVolder Subject: kexec: exclude elfcorehdr from the segment digest Date: Fri, 4 Aug 2023 17:03:54 -0400 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 checking. The digest is embedded into the purgatory image prior to placing in memory. Updates to the elfcorehdr in response to CPU and memory changes would cause the purgatory integrity checking to fail (at crash time, and no vmcore created). Therefore, the elfcorehdr segment is explicitly excluded from the purgatory digest, enabling updates to the elfcorehdr while also avoiding the need to recompute the hash digest and reload purgatory. Link: https://lkml.kernel.org/r/20230804210359.8321-4-eric.devolder@oracle.com Signed-off-by: Eric DeVolder Suggested-by: Baoquan He Reviewed-by: Sourabh Jain Acked-by: Hari Bathini Acked-by: Baoquan He Cc: Akhil Raj Cc: Bjorn Helgaas Cc: Borislav Petkov Cc: Boris Ostrovsky Cc: Dave Hansen Cc: Dave Young Cc: David Hildenbrand Cc: Eric W. Biederman Cc: Greg Kroah-Hartman Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jonathan Corbet Cc: Konrad Rzeszutek Wilk Cc: Mimi Zohar Cc: Naveen N. Rao Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Sean Christopherson Cc: Takashi Iwai Cc: Thomas Gleixner Cc: Thomas Weißschuh Cc: Valentin Schneider Cc: Vivek Goyal Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- kernel/kexec_file.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/kernel/kexec_file.c~kexec-exclude-elfcorehdr-from-the-segment-digest +++ a/kernel/kexec_file.c @@ -726,6 +726,12 @@ static int kexec_calculate_store_digests for (j = i = 0; i < image->nr_segments; i++) { struct kexec_segment *ksegment; +#ifdef CONFIG_CRASH_HOTPLUG + /* Exclude elfcorehdr segment to allow future changes via hotplug */ + if (j == image->elfcorehdr_index) + continue; +#endif + ksegment = &image->segment[i]; /* * Skip purgatory as it will be modified once we put digest _ Patches currently in -mm which might be from eric.devolder@oracle.com are kexec-consolidate-kexec-and-crash-options-into-kernel-kconfigkexec.patch x86-kexec-refactor-for-kernel-kconfigkexec.patch arm-kexec-refactor-for-kernel-kconfigkexec.patch ia64-kexec-refactor-for-kernel-kconfigkexec.patch arm64-kexec-refactor-for-kernel-kconfigkexec.patch loongarch-kexec-refactor-for-kernel-kconfigkexec.patch m68k-kexec-refactor-for-kernel-kconfigkexec.patch mips-kexec-refactor-for-kernel-kconfigkexec.patch parisc-kexec-refactor-for-kernel-kconfigkexec.patch powerpc-kexec-refactor-for-kernel-kconfigkexec.patch riscv-kexec-refactor-for-kernel-kconfigkexec.patch s390-kexec-refactor-for-kernel-kconfigkexec.patch sh-kexec-refactor-for-kernel-kconfigkexec.patch kexec-rename-arch_has_kexec_purgatory.patch remove-arch_default_kexec-from-kconfigkexec.patch crash-move-a-few-code-bits-to-setup-support-of-crash-hotplug.patch crash-add-generic-infrastructure-for-crash-hotplug-support.patch kexec-exclude-elfcorehdr-from-the-segment-digest.patch crash-memory-and-cpu-hotplug-sysfs-attributes.patch x86-crash-add-x86-crash-hotplug-support.patch crash-hotplug-support-for-kexec_load.patch crash-change-crash_prepare_elf64_headers-to-for_each_possible_cpu.patch x86-crash-optimize-cpu-changes.patch