Thread (58 messages) 58 messages, 11 authors, 2020-10-14

Re: [PATCH 12/14] x86: remove address space overrides using set_fs()

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2020-09-03 23:26:25
Also in: linux-arch, linux-fsdevel, lkml

On Thu, Sep 3, 2020 at 2:30 PM David Laight [off-list ref] wrote:
A non-canonical (is that the right term) address between the highest
valid user address and the lowest valid kernel address (7ffe to fffe?)
will fault anyway.
Yes.

But we actually warn against that fault, because it's been a good way
to catch places that didn't use the proper "access_ok()" pattern.

See ex_handler_uaccess() and the

        WARN_ONCE(trapnr == X86_TRAP_GP, "General protection fault in
user access. Non-canonical address?");

warning. It's been good for randomized testing - a missing range check
on a user address will often hit this.

Of course, you should never see it in real life (and hopefully not in
testing either any more). But belt-and-suspenders..

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