Re: [patch V3 00/12] uaccess: Provide and use scopes for user masked access

From: Peter Zijlstra
Date: Fri Oct 17 2025 - 06:38:29 EST


On Fri, Oct 17, 2025 at 12:08:54PM +0200, Thomas Gleixner wrote:

> After some back and forth discussion Linus suggested to put the local label
> workaround into the user access functions themself.

> Andrew thankfully pointed me to nested for() loops and after some head
> scratching I managed to get all of it hidden in that construct.

These two hacks are awesome and made my day; thanks!

> Thomas Gleixner (12):
> ARM: uaccess: Implement missing __get_user_asm_dword()
> uaccess: Provide ASM GOTO safe wrappers for unsafe_*_user()
> x86/uaccess: Use unsafe wrappers for ASM GOTO
> powerpc/uaccess: Use unsafe wrappers for ASM GOTO
> riscv/uaccess: Use unsafe wrappers for ASM GOTO
> s390/uaccess: Use unsafe wrappers for ASM GOTO
> uaccess: Provide scoped masked user access regions
> uaccess: Provide put/get_user_masked()
> futex: Convert to scoped masked user access
> x86/futex: Convert to scoped masked user access

Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

> select: Convert to scoped masked user access

Basically okay on this one too, except see the comment.

> coccinelle: misc: Add scoped_masked_$MODE_access() checker script

And that's just pure magic, I can't seem to get me head around
coccinelle syntax.