Skip to content

mm: make copy_to_kernel_nofault() not fault on user addresses

Omar Sandoval linux-arm-kernel linux-mips linux-mm linux-parisc linux-um linuxppc-dev lkml loongarch 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm: rename copy_from_kernel_nofault_allowed() to copy_kernel_nofault_allowed()arch/arm/mm/fault.c arch/loongarch/mm/maccess.c arch/mips/mm/maccess.c +6 more+12 -130 replies
2/2mm: make copy_to_kernel_nofault() not fault on user addressesmm/maccess.c+3 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] mm: make copy_to_kernel_nofault() not fault on user addresses

From: Omar Sandoval <[email protected]>

Hi,

I hit a case where copy_to_kernel_nofault() will fault (lol): if the destination address is in userspace and x86 Supervisor Mode Access Prevention is enabled. Patch 2 has the details and the fix. Patch 1 renames a helper function so that its use in patch 2 makes more sense. If the rename is too intrusive, I can drop it.

Thanks,
Omar

Omar Sandoval (2):
mm: rename copy_from_kernel_nofault_allowed() to
copy_kernel_nofault_allowed()
mm: make copy_to_kernel_nofault() not fault on user addresses

 arch/arm/mm/fault.c         |  2 +-
 arch/loongarch/mm/maccess.c |  2 +-
 arch/mips/mm/maccess.c      |  2 +-
 arch/parisc/lib/memcpy.c    |  2 +-
 arch/powerpc/mm/maccess.c   |  2 +-
 arch/um/kernel/maccess.c    |  2 +-
 arch/x86/mm/maccess.c       |  4 ++--
 include/linux/uaccess.h     |  2 +-
 mm/maccess.c                | 10 ++++++----
 9 files changed, 15 insertions(+), 13 deletions(-)
Signature · 1 line
2.46.0