loader: validate cmdline string length before appending verity arg

This commit is contained in:
Michael Marineau 2016-10-19 14:12:55 -07:00
parent 6d3b1dc72b
commit dab6a0f0c3
3 changed files with 12 additions and 6 deletions

View file

@ -1029,7 +1029,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
maximal_cmdline_size
- (sizeof (LINUX_IMAGE) - 1));
grub_pass_verity_hash(&lh, linux_cmdline);
grub_pass_verity_hash(&lh, linux_cmdline, maximal_cmdline_size);
len = prot_file_size;
grub_memcpy (prot_mode_mem, kernel + kernel_offset, len);
kernel_offset += len;