[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202101111152.CBF4BEDB@keescook>
Date: Mon, 11 Jan 2021 11:52:31 -0800
From: Kees Cook <keescook@...omium.org>
To: Alexander Lobakin <alobakin@...me>
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Nathan Chancellor <natechancellor@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Jinyang He <hejinyang@...ngson.cn>,
Ralf Baechle <ralf@...ux-mips.org>,
Matt Redfearn <matt.redfearn@...s.com>,
linux-mips@...r.kernel.org, stable@...r.kernel.org,
linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH mips-fixes] MIPS: relocatable: fix possible boot hangup
with KASLR enabled
On Sun, Jan 10, 2021 at 02:21:05PM +0000, Alexander Lobakin wrote:
> 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: stable@...r.kernel.org # 4.7+
> Signed-off-by: Alexander Lobakin <alobakin@...me>
Reviewed-by: Kees Cook <keescook@...omium.org>
--
Kees Cook
Powered by blists - more mailing lists