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

Linus Torvalds torvalds at linux-foundation.org
Fri Sep 4 09:25:54 AEST 2020


On Thu, Sep 3, 2020 at 2:30 PM David Laight <David.Laight at aculab.com> 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


More information about the Linuxppc-dev mailing list