diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2016-03-02 17:45:53 +0100 |
---|---|---|
committer | Werner Zeh <werner.zeh@siemens.com> | 2016-03-03 06:18:23 +0100 |
commit | bbf508914df2375efb38bedb0527b87eeac697c5 (patch) | |
tree | df3d56ac658c759fca55caa8dc2a004f1b835c64 /util/cbfstool/cbfs-payload-linux.c | |
parent | 266b5171a30e0334b7503ec3284665b244d77b61 (diff) | |
download | coreboot-bbf508914df2375efb38bedb0527b87eeac697c5.tar.gz coreboot-bbf508914df2375efb38bedb0527b87eeac697c5.tar.bz2 coreboot-bbf508914df2375efb38bedb0527b87eeac697c5.zip |
cbfstool: Initialize contents of linux_params to 0
When linux is used as payload, the parameters to the kernel are build
when cbfstool includes bzImage into the image. Since not all
parameters are used, the unused will stay uninitialized.
There is a chance, that the uninitialized parameters contain
random values. That in turn can lead to early kernel panic.
To avoid it, initialize all parameters with 0 at the beginning.
The ones that are used will be set up as needed and the rest
will contain 0 for sure. This way, kernel can deal with the
provided parameter list the right way.
Change-Id: Id081c24351ec80375255508378b5e1eba2a92e48
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/13874
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/cbfstool/cbfs-payload-linux.c')
-rw-r--r-- | util/cbfstool/cbfs-payload-linux.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs-payload-linux.c b/util/cbfstool/cbfs-payload-linux.c index 34b21e9054b1..79ee7eaa85d9 100644 --- a/util/cbfstool/cbfs-payload-linux.c +++ b/util/cbfstool/cbfs-payload-linux.c @@ -224,6 +224,8 @@ int parse_bzImage_to_payload(const struct buffer *input, /* Setup parameter block. Imitate FILO. */ struct linux_params params; + + memset(¶ms, 0, sizeof(struct linux_params)); params.mount_root_rdonly = hdr->root_flags; params.orig_root_dev = hdr->root_dev; /* Sensible video defaults. Might be overridden on runtime by coreboot tables. */ |