Re: [PATCH] x86/uaccess: Fix 32-bit __get_user_asm_u64() when CC_HAS_ASM_GOTO_OUTPUT=y

From: Linus Torvalds
Date: Mon Sep 13 2021 - 13:05:56 EST


On Mon, Sep 13, 2021 at 9:36 AM Will Deacon <will@xxxxxxxxxx> wrote:
>
> Use the existing '__gu_ptr' source pointer to unsigned int for 32-bit
> __get_user_asm_u64() instead of the original pointer.

Heh. And by "existing" you mean "the one that exists _purely_ for this
exact reason and that wasn't used" ;)

What a silly bug. And it's existed for a year, which I think shows
just how little 32-bit x86 is used these days (*).

Linus

(*) but also probably how few 64-bit user accesses we do - the fact
that the bug was actually found by the "copy_from_kernel_nofault" code
that just shares the infrastructure on x86 rather than any user access
code is kind of interesting.