Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH 0/3] proc,security,selinux: let SELinux block FOLL_FORCE for /proc/self/mem
@ 2026-08-18 19:51 Jann Horn
  2026-08-18 19:51 ` [PATCH 1/3] proc: refactor /proc/$pid/mem to use struct as private_data Jann Horn
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jann Horn @ 2026-08-18 19:51 UTC (permalink / raw)
  To: Paul Moore, James Morris, Serge E. Hallyn, Stephen Smalley,
	Jeff Xu, Thiébaud Weksteen
  Cc: Alexander Viro, Christian Brauner, Jan Kara, linux-fsdevel,
	linux-security-module, Ondrej Mosnacek, selinux, Andrew Morton,
	Liam R. Howlett, Lorenzo Stoakes, Vlastimil Babka, Pedro Falcato,
	David Hildenbrand, linux-mm, Jann Horn

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@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@google.com>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-08-20 18:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 19:51 [PATCH 0/3] proc,security,selinux: let SELinux block FOLL_FORCE for /proc/self/mem Jann Horn
2026-08-18 19:51 ` [PATCH 1/3] proc: refactor /proc/$pid/mem to use struct as private_data Jann Horn
2026-08-20 11:20   ` Jan Kara
2026-08-20 17:18   ` David Hildenbrand (Arm)
2026-08-18 19:51 ` [PATCH 2/3] proc: query LSMs for introspective mem access (if PROC_MEM_FORCE_ALWAYS) Jann Horn
2026-08-20 17:22   ` David Hildenbrand (Arm)
2026-08-20 18:44     ` Jann Horn
2026-08-18 19:51 ` [PATCH 3/3] selinux: require EXECMEM or PTRACE for FOLL_FORCE introspection Jann Horn
2026-08-19 14:54   ` Stephen Smalley
2026-08-20 15:23     ` Jann Horn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox