Thread (75 messages) 75 messages, 14 authors, 2022-02-25

Re: [PATCH v2 14/18] lib/test_lockup: fix kernel pointer check for separate address spaces

From: Arnd Bergmann <arnd@kernel.org>
Date: 2022-02-18 07:16:06
Also in: linux-alpha, linux-api, linux-arch, linux-m68k, linux-mips, linux-mm, linux-riscv, linux-s390, linux-sh, linuxppc-dev, lkml, sparclinux

On Fri, Feb 18, 2022 at 7:35 AM Christoph Hellwig [off-list ref] wrote:
On Wed, Feb 16, 2022 at 02:13:28PM +0100, Arnd Bergmann wrote:
quoted
From: Arnd Bergmann <arnd@arndb.de>

test_kernel_ptr() uses access_ok() to figure out if a given address
points to user space instead of kernel space. However on architectures
that set CONFIG_ALTERNATE_USER_ADDRESS_SPACE, a pointer can be valid
for both, and the check always fails because access_ok() returns true.

Make the check for user space pointers conditional on the type of
address space layout.
What is this code even trying to do?  It looks extremly broken.
As I understand it, this is only meant for debugging, and the module contains
intentionally broken lock usage to test whether the watchdog and lockup
detection in the kernel is able to find them.

I did not try that hard to understand how it works though.

      Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help