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

From: Josh Poimboeuf
Date: Wed May 05 2021 - 10:48:37 EST


On Wed, May 05, 2021 at 03:25:42PM +0100, Mark Rutland wrote:
> On arm64 we needed to have a sequence here because the addr_limit used
> to be variable, but now that we've removed set_fs() and split the
> user/kernel access routines we could simplify that to an AND with an
> immediate mask to force all pointers into the user half of the address
> space. IIUC x86_64 could do the same, and I think that was roughly what
> David was suggesting.

True. On 64-bit arches it might be as simple as just clearing the
most-significant bit.

--
Josh