diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-12-02 21:09:36 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-12-02 21:09:36 +0100 |
commit | 8a02ec8f35779335b81577903832c2b3c495e979 (patch) | |
tree | fcfea67b99cc17756549286858380eec410af68c /init | |
parent | Merge tag '5.10-rc6-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 (diff) | |
parent | docs: bootconfig: Add the endianness of fields (diff) | |
download | linux-8a02ec8f35779335b81577903832c2b3c495e979.tar.xz linux-8a02ec8f35779335b81577903832c2b3c495e979.zip |
Merge tag 'trace-v5.10-rc6-bootconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull bootconfig fixes from Steven Rostedt:
"Have bootconfig size and checksum be little endian
In case the bootconfig is created on one kind of endian machine, and
then read on the other kind of endian kernel, the size and checksum
will be incorrect. Instead, have both the size and checksum always be
little endian and have the tool and the kernel convert it from little
endian to or from the host endian"
* tag 'trace-v5.10-rc6-bootconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
docs: bootconfig: Add the endianness of fields
tools/bootconfig: Store size and checksum in footer as le32
bootconfig: Load size and checksum in the footer as le32
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/init/main.c b/init/main.c index 20baced721ad..32b2a8affafd 100644 --- a/init/main.c +++ b/init/main.c @@ -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) { |