[patch V4 00/12] uaccess: Provide and use scopes for user access

Thomas Gleixner posted 12 patches 3 months, 2 weeks ago
There is a newer version of this series
arch/arm/include/asm/uaccess.h               |   26 ++
arch/powerpc/include/asm/uaccess.h           |    8
arch/riscv/include/asm/uaccess.h             |    8
arch/s390/include/asm/uaccess.h              |    4
arch/x86/include/asm/futex.h                 |   75 ++----
arch/x86/include/asm/uaccess.h               |   12 -
fs/select.c                                  |   12 -
include/linux/uaccess.h                      |  308 ++++++++++++++++++++++++++-
kernel/futex/futex.h                         |   37 ---
scripts/coccinelle/misc/scoped_uaccess.cocci |  108 +++++++++
10 files changed, 492 insertions(+), 106 deletions(-)
[patch V4 00/12] uaccess: Provide and use scopes for user access
Posted by Thomas Gleixner 3 months, 2 weeks ago
This is a follow up on the V3 feedback:

   https://lore.kernel.org/20251017085938.150569636@linutronix.de

Changes vs. V3:

  - Remove the superflouous if (1) in the scope macro - Andrew

  - Use asm_inline in the x86 conversion - Andrew

  - Rename to scoped_user_*_access(), remove underscores, use a void
    intermediate pointer and add a comment vs. access range - David

  - Use read scope in select - PeterZ

  - Fix comments, shorten local variables and remove pointless brackets -
    Mathieu

  - Simplify the coccinelle script, which needs still more polishing -
    Julia

The series is based on v6.18-rc1 and also available from git:

    git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git uaccess/masked

Thanks,

	tglx
---
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 user access regions
      uaccess: Provide put/get_user_scoped()
      coccinelle: misc: Add scoped_$MODE_access() checker script
      futex: Convert to scoped user access
      x86/futex: Convert to scoped user access
      select: Convert to scoped user access
---
 arch/arm/include/asm/uaccess.h               |   26 ++
 arch/powerpc/include/asm/uaccess.h           |    8 
 arch/riscv/include/asm/uaccess.h             |    8 
 arch/s390/include/asm/uaccess.h              |    4 
 arch/x86/include/asm/futex.h                 |   75 ++----
 arch/x86/include/asm/uaccess.h               |   12 -
 fs/select.c                                  |   12 -
 include/linux/uaccess.h                      |  308 ++++++++++++++++++++++++++-
 kernel/futex/futex.h                         |   37 ---
 scripts/coccinelle/misc/scoped_uaccess.cocci |  108 +++++++++
 10 files changed, 492 insertions(+), 106 deletions(-)
Re: [patch V4 00/12] uaccess: Provide and use scopes for user access
Posted by Peter Zijlstra 3 months, 2 weeks ago
On Wed, Oct 22, 2025 at 02:49:02PM +0200, Thomas Gleixner wrote:

> 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 user access regions
>       uaccess: Provide put/get_user_scoped()
>       futex: Convert to scoped user access
>       x86/futex: Convert to scoped user access
>       select: Convert to scoped user access

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>