Skip to content

Commit 6a31fcd

Browse files
prsriva02mimizohar
authored andcommitted
KEXEC: Call ima_kexec_cmdline to measure the boot command line args
During soft reboot(kexec_file_load) boot command line arguments are not measured. Call ima hook ima_kexec_cmdline to measure the boot command line arguments into IMA measurement list. - call ima_kexec_cmdline from kexec_file_load. - move the call ima_add_kexec_buffer after the cmdline args have been measured. Signed-off-by: Prakhar Srivastava <prsriva02@gmail.com> Reviewed-by: James Morris <jamorris@linux.microsoft.com> Acked-by: Dave Young <dyoung@redhat.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
1 parent 86b4da8 commit 6a31fcd

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎kernel/kexec_file.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd,
198198
return ret;
199199
image->kernel_buf_len = size;
200200

201-
/* IMA needs to pass the measurement list to the next kernel. */
202-
ima_add_kexec_buffer(image);
203-
204201
/* Call arch image probe handlers */
205202
ret = arch_kexec_kernel_image_probe(image, image->kernel_buf,
206203
image->kernel_buf_len);
@@ -241,8 +238,14 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd,
241238
ret = -EINVAL;
242239
goto out;
243240
}
241+
242+
ima_kexec_cmdline(image->cmdline_buf,
243+
image->cmdline_buf_len - 1);
244244
}
245245

246+
/* IMA needs to pass the measurement list to the next kernel. */
247+
ima_add_kexec_buffer(image);
248+
246249
/* Call arch image load handlers */
247250
ldata = arch_kexec_kernel_image_load(image);
248251

0 commit comments

Comments
 (0)