verifiers: Add possibility to verify kernel and modules command lines
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com> Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
This commit is contained in:
parent
03a713b7ab
commit
0f20a51812
19 changed files with 139 additions and 56 deletions
|
@ -327,6 +327,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
linux_argv++;
|
||||
linux_args += ALIGN_UP (sizeof ("a0"), 4);
|
||||
|
||||
char *params = linux_args;
|
||||
|
||||
#ifdef GRUB_MACHINE_MIPS_LOONGSON
|
||||
{
|
||||
unsigned mtype = grub_arch_machine;
|
||||
|
@ -352,6 +354,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
linux_args += ALIGN_UP (grub_strlen (argv[i]) + 1, 4);
|
||||
}
|
||||
|
||||
*linux_args = '\0';
|
||||
|
||||
err = grub_verify_string (params, GRUB_VERIFY_KERNEL_CMDLINE);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* Reserve space for rd arguments. */
|
||||
rd_addr_arg_off = (grub_uint8_t *) linux_args - (grub_uint8_t *) playground;
|
||||
linux_args += ALIGN_UP (sizeof ("rd_start=0xXXXXXXXXXXXXXXXX"), 4);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue