Skip to content

uaccess: unify inline vs outline copy_{from,to}_user() selection

Yury Norov lkml 2 versions – Applied

Status from this message: [merged mm-nonmm-stable] uaccess-minimize-inline_copy_user-related-ifdefery.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesApplied 3/3
  2. v12 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- reword cover letter (Andrew);
- add v2#1 to fix rust/uaccess explicitly (Alice);

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3rust: uaccess: use INLINE_COPY_TO_USER to guard copy_to_user()rust/helpers/uaccess.c+2 -01 replyApplied
2/3uaccess: unify inline vs outline copy_{from,to}_user() selectionarch/arc/include/asm/uaccess.h arch/arm/include/asm/uaccess.h arch/arm64/include/asm/uaccess.h +18 more+26 -480 repliesApplied
3/3uaccess: minimize INLINE_COPY_USER-related ifdeferyinclude/linux/uaccess.h+7 -140 repliesApplied

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchAlice Ryhl
1/3R-b
2/3T-b
3/3T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] uaccess: unify inline vs outline copy_{from,to}_user() selection

The kernel allows arches to select between inline and outline implementations of the copy_{from,to}_user() by defining individual INLINE_COPY_FROM_USER and INLINE_COPY_TO_USER, correspondingly. However, all arches enable or disable them always together.

Without the real use-case for one helper being inlined while the other outlined, having independent controls is excessive and error prone.

The first patch of the series fixes rust/uaccess coppy_to_user() wrapper guarded with INLINE_COPY_FROM_USER. The 2nd patch switches codebase to the unified INLINE_COPY_USER. And the last patch cleans up ifdefery in the include/linux/uaccess.h

---
v1: https://lore.kernel.org/all/[email protected]/
v2:
- reword cover letter (Andrew);
- add v2#1 to fix rust/uaccess explicitly (Alice);

Yury Norov (3):
rust: uaccess: use INLINE_COPY_TO_USER to guard copy_to_user()
uaccess: unify inline vs outline copy_{from,to}_user() selection
uaccess: minimize INLINE_COPY_USER-related ifdefery

 arch/arc/include/asm/uaccess.h        |  3 +--
 arch/arm/include/asm/uaccess.h        |  3 +--
 arch/arm64/include/asm/uaccess.h      |  3 +--
 arch/hexagon/include/asm/uaccess.h    |  3 +--
 arch/loongarch/include/asm/uaccess.h  |  3 +--
 arch/m68k/include/asm/uaccess.h       |  3 +--
 arch/microblaze/include/asm/uaccess.h |  3 +--
 arch/mips/include/asm/uaccess.h       |  3 +--
 arch/nios2/include/asm/uaccess.h      |  3 +--
 arch/openrisc/include/asm/uaccess.h   |  3 +--
 arch/parisc/include/asm/uaccess.h     |  3 +--
 arch/s390/include/asm/uaccess.h       |  3 +--
 arch/sh/include/asm/uaccess.h         |  3 +--
 arch/sparc/include/asm/uaccess_32.h   |  3 +--
 arch/sparc/include/asm/uaccess_64.h   |  3 +--
 arch/um/include/asm/uaccess.h         |  3 +--
 arch/xtensa/include/asm/uaccess.h     |  3 +--
 include/asm-generic/uaccess.h         |  3 +--
 include/linux/uaccess.h               | 25 +++++++++----------------
 lib/usercopy.c                        |  4 +---
 rust/helpers/uaccess.c                |  2 +-
 21 files changed, 29 insertions(+), 56 deletions(-)
Signature · 1 line
2.51.0