]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: boot: Fix unaligned access with CONFIG_MIPS_RAW_APPENDED_DTB
authorPaul Cercueil <paul@crapouillou.net>
Wed, 16 Dec 2020 23:39:56 +0000 (23:39 +0000)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Mon, 28 Dec 2020 22:26:16 +0000 (23:26 +0100)
commit4d4f9c1a17a3480f8fe523673f7232b254d724b7
tree19e316e32f1ced9893a03188f3826ee4d6e5e483
parent5c8fe583cce542aa0b84adc939ce85293de36e5e
MIPS: boot: Fix unaligned access with CONFIG_MIPS_RAW_APPENDED_DTB

The compressed payload is not necesarily 4-byte aligned, at least when
compiling with Clang. In that case, the 4-byte value appended to the
compressed payload that corresponds to the uncompressed kernel image
size must be read using get_unaligned_le32().

This fixes Clang-built kernels not booting on MIPS (tested on a Ingenic
JZ4770 board).

Fixes: b8f54f2cde78 ("MIPS: ZBOOT: copy appended dtb to the end of the kernel")
Cc: <stable@vger.kernel.org> # v4.7
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/boot/compressed/decompress.c