linux/arch/mips/kernel
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
..
syscalls epoll: fix compat syscall wire up of epoll_pwait2 2020-12-20 10:01:38 -08:00
.gitignore
Makefile MIPS: cpu-probe: introduce exclusive R3k CPU probe 2020-10-12 12:05:16 +02:00
asm-offsets.c
binfmt_elfn32.c MIPS: Fix malformed NT_FILE and NT_SIGINFO in 32bit coredumps 2020-12-28 23:26:17 +01:00
binfmt_elfo32.c MIPS: Fix malformed NT_FILE and NT_SIGINFO in 32bit coredumps 2020-12-28 23:26:17 +01:00
bmips_5xxx_init.S
bmips_vec.S
branch.c
cacheinfo.c
cevt-bcm1480.c
cevt-ds1287.c
cevt-gt641xx.c
cevt-r4k.c
cevt-sb1250.c
cevt-txx9.c
cmpxchg.c
cps-vec-ns16550.S
cps-vec.S
cpu-probe.c MIPS: cpu-probe: remove MIPS_CPU_BP_GHIST option bit 2020-10-12 12:05:40 +02:00
cpu-r3k-probe.c MIPS: cpu-probe: introduce exclusive R3k CPU probe 2020-10-12 12:05:16 +02:00
crash.c
crash_dump.c
csrc-bcm1480.c
csrc-ioasic.c
csrc-r4k.c
csrc-sb1250.c
early_printk.c
early_printk_8250.c
elf.c
entry.S
fpu-probe.c
fpu-probe.h
ftrace.c
genex.S
gpio_txx9.c
head.S
i8253.c
idle.c sched/idle: Fix arch_cpu_idle() vs tracing 2020-11-24 16:47:35 +01:00
irq-gt641xx.c
irq-msc01.c
irq-rm7000.c
irq.c
irq_txx9.c
jump_label.c
kgdb.c
kprobes.c
linux32.c
machine_kexec.c
mcount.S
mips-cm.c mips: cm: add missing iounmap() on error in mips_cm_probe() 2020-11-06 11:33:11 +01:00
mips-cpc.c
mips-mt-fpaff.c
mips-mt.c
mips-r2-to-r6-emul.c
module.c
octeon_switch.S
perf_event.c
perf_event_mipsxx.c
pm-cps.c
pm.c
probes-common.h
proc.c
process.c smp: Cleanup smp_call_function*() 2020-11-24 16:47:49 +01:00
prom.c
ptrace.c
ptrace32.c
r4k-bugs64.c
r4k_fpu.S
r4k_switch.S
r2300_fpu.S
r2300_switch.S
relocate.c MIPS: relocatable: fix possible boot hangup with KASLR enabled 2021-01-13 10:59:04 +01:00
relocate_kernel.S
reset.c
rtlx-cmp.c
rtlx-mt.c
rtlx.c
scall32-o32.S
scall64-n32.S
scall64-n64.S
scall64-o32.S
segment.c
setup.c MIPS: Move memblock_dump_all() to the end of setup_arch() 2020-12-04 13:01:57 +01:00
signal-common.h
signal.c mips: add support for TIF_NOTIFY_SIGNAL 2020-11-09 08:16:55 -07:00
signal32.c
signal_n32.c
signal_o32.c
smp-bmips.c MIPS: No need to check CPU 0 in {loongson3,bmips,octeon}_cpu_disable() 2020-11-27 10:38:12 +01:00
smp-cmp.c
smp-cps.c MIPS: SMP-CPS: Add support for irq migration when CPU offline 2020-12-04 13:01:47 +01:00
smp-mt.c
smp-up.c
smp.c smp: Cleanup smp_call_function*() 2020-11-24 16:47:49 +01:00
spinlock_test.c
spram.c
stacktrace.c
sync-r4k.c
syscall.c
sysrq.c
time.c
topology.c
traps.c MIPS updates for v5.10: 2020-10-16 12:40:55 -07:00
unaligned.c
uprobes.c
vdso.c MIPS: vdso: Use vma page protection for remapping 2020-11-19 13:26:38 +01:00
vmlinux.lds.S
vpe-cmp.c
vpe-mt.c
vpe.c
watch.c