Re: [PATCH] x86/uaccess: Use pointer masking to limit uaccess speculation

From: Christoph Hellwig
Date: Tue Sep 01 2020 - 11:54:26 EST


On Tue, Sep 01, 2020 at 05:05:53PM +0200, Christoph Hellwig wrote:
> > Is there anything in particular that's tricky, or do you just want
> > someone to look generally? From a quick grep arch/arm64/* looks clean, but
> > I suspect that's misleading.
>
> Yes, it should be mostly trivial. I just bet the maintainers are
> better at optimizing the low-level assembly code with the variable
> address limit gone than I am. (See Linus comments on the x86 version
> for example). And I don't have a physical arm64 to test with so I'd
> have to rely on qemu for any testing.

So I looked at the arm64 code and I don't think it is entirely trivial,
due to the orig_addr_limit saving in the syscall entry path, and due
to all the UAO stuff. On the plus side it looks to me like
CONFIG_ARM64_UAO and all the code relate to it can go away entirely
if set_fs() is gone.

So if I can trick you guys into submiting a patch on top of:

http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/set_fs-removal

that would make my life a lot simpler.