Thread (15 messages) 15 messages, 3 authors, 2020-11-06

Re: [PATCH 2/9] ARM: traps: use get_kernel_nofault instead of set_fs()

From: Linus Walleij <hidden>
Date: 2020-11-06 09:02:30
Also in: linux-arm-kernel, linux-mm, lkml

On Fri, Oct 30, 2020 at 4:49 PM Arnd Bergmann [off-list ref] wrote:
From: Arnd Bergmann <arnd@arndb.de>

ARM uses set_fs() and __get_user() to allow the stack dumping code to
access possibly invalid pointers carefully. These can be changed to the
simpler get_kernel_nofault(), and allow the eventual removal of set_fs().

dump_instr() will print either kernel or user space pointers,
depending on how it was called. For dump_mem(), I assume we are only
interested in kernel pointers, and the only time that this is called
with user_mode(regs)==true is when the regs themselves are unreliable
as a result of the condition that caused the trap.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Not to mention the drastically improved readability of the code,
as ARM developers no more needs to cross-reference the
x86 FS segment register to figure out what this might be
doing.

Reviewed-by: Linus Walleij <redacted>

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