Skip to content

Commit f8a9c11

Browse files
Vasily Gorbikhcahca
authored andcommitted
s390/kexec: Emit an error message when cmdline is too long
Currently, if the command line passed to kexec_file_load() exceeds the supported limit of the kernel being kexec'd, -EINVAL is returned to userspace, which is consistent across architectures. Since -EINVAL is not specific to this case, the kexec tool cannot provide a specific reason for the failure. Many architectures emit an error message in this case. Add a similar error message, including the effective limit, since the command line length is configurable. Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent b8555fb commit f8a9c11

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

arch/s390/kernel/machine_kexec_file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ void *kexec_file_add_components(struct kimage *image,
270270
if (image->kernel_buf_len < minsize + max_command_line_size)
271271
goto out;
272272

273-
if (image->cmdline_buf_len >= max_command_line_size)
273+
if (image->cmdline_buf_len >= max_command_line_size) {
274+
pr_err("Kernel command line exceeds supported limit of %lu", max_command_line_size);
274275
goto out;
276+
}
275277

276278
memcpy(data.parm->command_line, image->cmdline_buf,
277279
image->cmdline_buf_len);

0 commit comments

Comments
 (0)