mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 10:01:00 +00:00
kexec_file: fix elfcorehdr digest exclusion when CONFIG_CRASH_HOTPLUG=y
commit6dacd79d28
upstream. Fix the condition to exclude the elfcorehdr segment from the SHA digest calculation. The j iterator is an index into the output sha_regions[] array, not into the input image->segment[] array. Once it reaches image->elfcorehdr_index, all subsequent segments are excluded. Besides, if the purgatory segment precedes the elfcorehdr segment, the elfcorehdr may be wrongly included in the calculation. Link: https://lkml.kernel.org/r/20240805150750.170739-1-petr.tesarik@suse.com Fixes:f7cc804a9f
("kexec: exclude elfcorehdr from the segment digest") Signed-off-by: Petr Tesarik <ptesarik@suse.com> Acked-by: Baoquan He <bhe@redhat.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Hari Bathini <hbathini@linux.ibm.com> Cc: Sourabh Jain <sourabhjain@linux.ibm.com> Cc: Eric DeVolder <eric_devolder@yahoo.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8fecde9c3f
commit
c318a4bb36
1 changed files with 1 additions and 1 deletions
|
@ -728,7 +728,7 @@ static int kexec_calculate_store_digests(struct kimage *image)
|
|||
|
||||
#ifdef CONFIG_CRASH_HOTPLUG
|
||||
/* Exclude elfcorehdr segment to allow future changes via hotplug */
|
||||
if (j == image->elfcorehdr_index)
|
||||
if (i == image->elfcorehdr_index)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue