Skip to content

Commit

Permalink
bootconfig: Load size and checksum in the footer as le32
Browse files Browse the repository at this point in the history
Load the size and the checksum fields in the footer as le32
instead of u32. This will allow us to apply bootconfig to the
cross build initrd without caring the endianness.

Link: https://lkml.kernel.org/r/160583934457.547349.10504070298990791074.stgit@devnote2

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Masami Hiramatsu authored and Steven Rostedt (VMware) committed Dec 1, 2020
1 parent 68e10d5 commit 24aed09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ static void * __init get_boot_config_from_initrd(u32 *_size, u32 *_csum)

found:
hdr = (u32 *)(data - 8);
size = hdr[0];
csum = hdr[1];
size = le32_to_cpu(hdr[0]);
csum = le32_to_cpu(hdr[1]);

data = ((void *)hdr) - size;
if ((unsigned long)data < initrd_start) {
Expand Down

0 comments on commit 24aed09

Please sign in to comment.