summaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorKristina Martšenko <kristina.martsenko@arm.com>2025-02-28 20:00:06 +0300
committerCatalin Marinas <catalin.marinas@arm.com>2025-03-07 21:30:16 +0300
commitfe59e0358d9b032a09d903350d5fef73601166f2 (patch)
tree3841fe01cb8201dfec1b8d43826aa5a05231e4a1 /lib/test_fortify/write_overflow-strncpy-src.c
parent04a9f771d81c109b3927d224a797dc21e2774a5e (diff)
downloadlinux-fe59e0358d9b032a09d903350d5fef73601166f2.tar.xz
arm64: lib: Use MOPS for usercopy routines
Similarly to what was done with the memcpy() routines, make copy_to_user(), copy_from_user() and clear_user() also use the Armv8.8 FEAT_MOPS instructions. Both MOPS implementation options (A and B) are supported, including asymmetric systems. The exception fixup code fixes up the registers according to the option used. In case of a fault the routines return precisely how much was not copied (as required by the comment in include/linux/uaccess.h), as unprivileged versions of CPY/SET are guaranteed not to have written past the addresses reported in the GPRs. The MOPS instructions could possibly be inlined into callers (and patched to branch to the generic implementation if not detected; similarly to what x86 does), but as a first step this patch just uses them in the out-of-line routines. Signed-off-by: Kristina Martšenko <kristina.martsenko@arm.com> Acked-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/20250228170006.390100-4-kristina.martsenko@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions