Skip to content

add fault injection to user memory access

[email protected] linux-arch linux-doc lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesIn review 2 of 3 applied
  2. v23 patches 5 repliesSuperseded
  3. v13 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- adressed comments from Peter Zijlstra: fixed inconsistent ordering with might_fault()

Patches in v3 2 of 3 applied

#Subject and filesSizeRepliesApplied
1/3lib, include/linux: add usercopy failure capabilityDocumentation/admin-guide/kernel-parameters.txt Documentation/fault-injection/fault-injection.rst include/linux/fault-inject-usercopy.h +3 more+76 -10 repliesApplied
2/3lib, uaccess: add failure injection to usercopy functionsinclude/linux/uaccess.h lib/iov_iter.c lib/strncpy_from_user.c +1 more+22 -20 repliesApplied
3/3x86: add failure injection to get/put/clear_userarch/x86/include/asm/uaccess.h arch/x86/lib/usercopy_64.c+42 -290 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAkinobu MitaAlexander Potapenko
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/3] add fault injection to user memory access

From: Albert van der Linde <[email protected]>

The goal of this series is to improve testing of fault-tolerance in usages of user memory access functions, by adding support for fault injection.

The first patch adds failure injection capability for usercopy functions. The second changes usercopy functions to use this new failure capability (copy_from_user, ...). The third patch adds get/put/clear_user failures to x86.

Changes in v2:
- simplified overall failure capability by either failing or not, without having functions fail partially by copying/clearing only some bytes

Changes in v3:
- adressed comments from Peter Zijlstra: fixed inconsistent ordering with might_fault()

Albert van der Linde (3):
lib, include/linux: add usercopy failure capability lib, uaccess: add failure injection to usercopy functions
x86: add failure injection to get/put/clear_user

 .../admin-guide/kernel-parameters.txt         |  1 +
 .../fault-injection/fault-injection.rst       |  7 +-
 arch/x86/include/asm/uaccess.h                | 68 +++++++++++--------
 arch/x86/lib/usercopy_64.c                    |  3 +
 include/linux/fault-inject-usercopy.h         | 22 ++++++
 include/linux/uaccess.h                       | 11 ++-
 lib/Kconfig.debug                             |  7 ++
 lib/Makefile                                  |  1 +
 lib/fault-inject-usercopy.c                   | 39 +++++++++++
 lib/iov_iter.c                                |  5 ++
 lib/strncpy_from_user.c                       |  3 +
 lib/usercopy.c                                |  5 +-
 12 files changed, 140 insertions(+), 32 deletions(-)
 create mode 100644 include/linux/fault-inject-usercopy.h
 create mode 100644 lib/fault-inject-usercopy.c
Signature · 1 line
2.28.0.402.g5ffc5be6b7-goog