ARM: 9106/1: traps: use get_kernel_nofault instead of set_fs()
authorArnd Bergmann <arnd@arndb.de>
Wed, 11 Aug 2021 07:30:19 +0000 (08:30 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 20 Aug 2021 10:39:25 +0000 (11:39 +0100)
commit344179fc7ef427910de438affbf3703fed51fe5a
tree63bd7fff6b11fa5e87f938332269992695754cae
parent2423de2e6f4d8676b6f6e43dee437461023ca6a1
ARM: 9106/1: traps: use get_kernel_nofault instead of set_fs()

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>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/kernel/traps.c