[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZaQnG-mFs6q4DGtupRbcw50mhimsKmFz0FxOGLbSNO_w@mail.gmail.com>
Date: Fri, 6 Nov 2020 10:02:14 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Russell King <linux@...linux.org.uk>,
Christoph Hellwig <hch@....de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux-Arch <linux-arch@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
Al Viro <viro@...iv.linux.org.uk>,
Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH 2/9] ARM: traps: use get_kernel_nofault instead of set_fs()
On Fri, Oct 30, 2020 at 4:49 PM Arnd Bergmann <arnd@...nel.org> wrote:
> From: Arnd Bergmann <arnd@...db.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@....de>
> Signed-off-by: Arnd Bergmann <arnd@...db.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 <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists