Alexander Gordeev <agordeev@xxxxxxxxxxxxx> writes: > On Mon, Jan 22, 2024 at 04:27:05PM -0800, Kees Cook wrote: >> diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c >> index 8d207b82d9fe..e5e925423061 100644 >> --- a/arch/s390/kernel/machine_kexec_file.c >> +++ b/arch/s390/kernel/machine_kexec_file.c >> @@ -238,6 +238,7 @@ void *kexec_file_add_components(struct kimage *image, >> unsigned long max_command_line_size = LEGACY_COMMAND_LINE_SIZE; >> struct s390_load_data data = {0}; >> unsigned long minsize; >> + unsigned long sum; > > Please, use min_kernel_buf_len instead of sum. > > @Sven, could you please correct me if (minsize + max_command_line_size) > means something else. Your understanding is correct, minsize + max_command_line_size is the minimum required size of the kernel image.