summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-12-02 12:09:36 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-12-02 12:09:36 -0800
commit8a02ec8f35779335b81577903832c2b3c495e979 (patch)
treefcfea67b99cc17756549286858380eec410af68c /init
parent509a15421674b9e1a3e1916939d0d0efd3e578da (diff)
parent05227490c5f0f1bbd3693a7a70b3fb5b09d2a996 (diff)
downloadlinux-8a02ec8f35779335b81577903832c2b3c495e979.tar.gz
linux-8a02ec8f35779335b81577903832c2b3c495e979.tar.bz2
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.c4
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) {