Skip to content

Harden userfaultfd

Daniel Colascione kvm linux-api linux-fsdevel linux-security-module lkml oe-kbuild-all selinux 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 22 repliesIn review
  2. v17 patches 34 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Add a new flags-accepting interface for anonymous inodesfs/anon_inodes.c include/linux/anon_inodes.h+59 -302 replies
2/6Add a concept of a "secure" anonymous filefs/anon_inodes.c include/linux/lsm_hooks.h include/linux/security.h +1 more+53 -101 reply
3/6Teach SELinux about a new userfaultfd classfs/userfaultfd.c include/linux/userfaultfd_k.h security/selinux/hooks.c +1 more+73 -38 replies
4/6Wire UFFD up to SELinuxfs/userfaultfd.c+5 -20 replies
5/6Let userfaultfd opt out of handling kernel-mode faultsfs/userfaultfd.c include/uapi/linux/userfaultfd.h+15 -10 replies
6/6Add a new sysctl for limiting userfaultfd to user mode faultsDocumentation/admin-guide/sysctl/vm.rst fs/userfaultfd.c include/linux/userfaultfd_k.h +1 more+33 -10 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchStephen SmalleyCasey Schaufler
SeriesA-b A-b A-b
1/6
2/6
3/6
4/6
5/6
6/6

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/6] Harden userfaultfd

Userfaultfd in unprivileged contexts could be potentially very useful. We'd like to harden userfaultfd to make such unprivileged use less risky. This patch series allows SELinux to manage userfaultfd file descriptors and allows administrators to limit userfaultfd to servicing user-mode faults, increasing the difficulty of using userfaultfd in exploit chains invoking delaying kernel faults.

A new anon_inodes interface allows callers to opt into SELinux management of anonymous file objects. In this mode, anon_inodes creates new ephemeral inodes for anonymous file objects instead of reusing a singleton dummy inode. A new LSM hook gives security modules an opportunity to configure and veto these ephemeral inodes.

Existing anon_inodes users must opt into the new functionality.

Daniel Colascione (6):
Add a new flags-accepting interface for anonymous inodes Add a concept of a "secure" anonymous file
Teach SELinux about a new userfaultfd class
Wire UFFD up to SELinux
Let userfaultfd opt out of handling kernel-mode faults Add a new sysctl for limiting userfaultfd to user mode faults

 Documentation/admin-guide/sysctl/vm.rst | 13 ++++
 fs/anon_inodes.c                        | 89 +++++++++++++++++--------
 fs/userfaultfd.c                        | 29 ++++++--
 include/linux/anon_inodes.h             | 27 ++++++--
 include/linux/lsm_hooks.h               |  8 +++
 include/linux/security.h                |  2 +
 include/linux/userfaultfd_k.h           |  3 +
 include/uapi/linux/userfaultfd.h        |  9 +++
 kernel/sysctl.c                         |  9 +++
 security/security.c                     |  8 +++
 security/selinux/hooks.c                | 68 +++++++++++++++++++
 security/selinux/include/classmap.h     |  2 +
 12 files changed, 229 insertions(+), 38 deletions(-)
Signature · 1 line
2.25.0.225.g125e21ebc7-goog