diff options
author | Alexander Lobakin <[email protected]> | 2021-01-10 14:21:05 +0000 |
---|---|---|
committer | Thomas Bogendoerfer <[email protected]> | 2021-01-13 10:59:04 +0100 |
commit | 69e976831cd53f9ba304fd20305b2025ecc78eab (patch) | |
tree | f7c79532e16b1f1dc788db4bc6b357aec781cb2c /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | 698222457465ce343443be81c5512edda86e5914 (diff) |
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: 405bc8fd12f5 ("MIPS: Kernel: Implement KASLR using CONFIG_RELOCATABLE")
Cc: [email protected] # 4.7+
Signed-off-by: Alexander Lobakin <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions