1
0
Fork 0
alistair23-linux/arch
Alexander Lobakin 69e976831c MIPS: relocatable: fix possible boot hangup with KASLR enabled
LLVM-built Linux triggered a boot hangup with KASLR enabled.

arch/mips/kernel/relocate.c:get_random_boot() uses linux_banner,
which is a string constant, as a random seed, but accesses it
as an array of unsigned long (in rotate_xor()).
When the address of linux_banner is not aligned to sizeof(long),
such access emits unaligned access exception and hangs the kernel.

Use PTR_ALIGN() to align input address to sizeof(long) and also
align down the input length to prevent possible access-beyond-end.

Fixes: 405bc8fd12 ("MIPS: Kernel: Implement KASLR using CONFIG_RELOCATABLE")
Cc: stable@vger.kernel.org # 4.7+
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-01-13 10:59:04 +01:00
..
alpha A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
arc tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
arm A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
arm64 A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
c6x tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
csky Tracing updates for 5.11 2020-12-17 13:22:17 -08:00
h8300 tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
hexagon tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
ia64 Kbuild updates for v5.11 2020-12-22 14:02:39 -08:00
m68k Fixes include: 2020-12-21 10:35:11 -08:00
microblaze epoll: wire up syscall epoll_pwait2 2020-12-19 11:18:38 -08:00
mips MIPS: relocatable: fix possible boot hangup with KASLR enabled 2021-01-13 10:59:04 +01:00
nds32 Tracing updates for 5.11 2020-12-17 13:22:17 -08:00
nios2 tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
openrisc OpenRISC updates for 5.11 2020-12-17 13:41:27 -08:00
parisc A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
powerpc powerpc fixes for 5.11 #2 2020-12-24 14:02:00 -08:00
riscv RISC-V Fixes for 5.11-rc1 2020-12-24 14:05:05 -08:00
s390 A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
sh The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
sparc epoll: fix compat syscall wire up of epoll_pwait2 2020-12-20 10:01:38 -08:00
um This pull request contains the following changes for UML: 2020-12-17 17:56:44 -08:00
x86 A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
xtensa The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
.gitignore
Kconfig kasan: allow VMAP_STACK for HW_TAGS mode 2020-12-22 12:55:08 -08:00