[PATCH 0/3] proc,security,selinux: let SELinux block FOLL_FORCE for /proc/self/mem
Jann Horn
jannh at google.com
Tue Aug 18 19:51:04 UTC 2026
The goal of this series is to let SELinux prevent the use of FOLL_FORCE
when a process writes into /proc/self/mem and the system is configured
with PROC_MEM_FORCE_ALWAYS (which used to be the default behavior, and
is still used by current Android devices).
Android has SELinux policy that attempts to ensure that only trusted
code can be mapped as executable in several system processes, but this
protection can currently be bypassed by writing into /proc/self/mem.
I wrote this series after discussion with Android security folks about
the state of proc_mem_foll_force() restrictions on Android.
I'm sending this to:
- maintainers for LSM hooks
- maintainers for SELinux
- maintainers for VFS (because I think they generally own procfs?)
- some MM folks just as FYI since this touches GUP usage
- the Android folks I talked to about this
I think this should probably go through either the VFS tree or the
LSM tree.
The motivation for this series is that Project Zero managed to write a
remote exploit for Google Pixel partly because of /proc/self/mem, see
<https://projectzero.google/2026/01/pixel-0-click-part-1.html#whats-the-plan-seth-and-jann>.
Signed-off-by: Jann Horn <jannh at google.com>
---
Jann Horn (3):
proc: refactor /proc/$pid/mem to use struct as private_data
proc: query LSMs for introspective mem access (if PROC_MEM_FORCE_ALWAYS)
selinux: require EXECMEM or PTRACE for FOLL_FORCE introspection
fs/proc/base.c | 35 ++++++++++++++++++++++++++++++++---
include/linux/lsm_hook_defs.h | 1 +
include/linux/security.h | 6 ++++++
security/security.c | 15 +++++++++++++++
security/selinux/hooks.c | 27 +++++++++++++++++++++++++++
5 files changed, 81 insertions(+), 3 deletions(-)
---
base-commit: 2f1baf1fc8929e6c48370be543ad028ac7ad4131
change-id: 20260814-selinux-pokemem-44625557c4d4
Best regards,
--
Jann Horn <jannh at google.com>
More information about the Linux-security-module-archive
mailing list