SELinux Security Module development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
Cc: selinux@vger.kernel.org
Subject: Re: [PATCH 2/3] proc: query LSMs for introspective mem access (if PROC_MEM_FORCE_ALWAYS)
Date: Tue, 18 Aug 2026 20:00:09 +0000	[thread overview]
Message-ID: <20260818200009.C2C3E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818-selinux-pokemem-v1-2-90cd2357ee05@google.com>

> If the system is running with PROC_MEM_FORCE_ALWAYS, LSMs currently have no
> good opportunity to block a process from overwriting read-only code in its
> own address space through FOLL_FORCE writes via /proc/self/mem.
> The security_ptrace_access_check() LSM hook is bypassed when a process
> opens /proc/self/mem because this is considered "introspection".
> 
> This causes a hole in SELinux EXECMEM enforcement, which tries to ensure
> that a process cannot create executable anonymous pages.
> 
> PROC_MEM_FORCE_PTRACE prevents that and ensures that such FOLL_FORCE
> accesses are only possible when the LSM allows ptrace() attachment; but it
> is unclear how quickly PROC_MEM_FORCE_PTRACE can be deployed in
> environments running lots of third-party code, such as Android.
> 
> So, introduce a new LSM hook that can forbid FOLL_FORCE specifically for
> such "introspective" accesses.
> 
> Signed-off-by: Jann Horn <jannh@google.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260818-selinux-pokemem-v1-0-90cd2357ee05@google.com?part=2


  reply	other threads:[~2026-08-18 20:00 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-18 19:58   ` sashiko-bot
2026-08-20 11:20   ` Jan Kara
2026-08-20 17:18   ` David Hildenbrand (Arm)
2026-08-21 18:34   ` Lorenzo Stoakes (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-18 20:00   ` sashiko-bot [this message]
2026-08-20 17:22   ` David Hildenbrand (Arm)
2026-08-20 18:44     ` Jann Horn
2026-08-21 14:18       ` David Hildenbrand (Arm)
2026-08-21 14:48         ` Jann Horn
2026-08-21 18:52           ` Lorenzo Stoakes (ARM)
2026-08-24 17:06             ` Jann Horn
2026-08-24 17:32               ` Lorenzo Stoakes (ARM)
2026-08-24 17:43                 ` Jann Horn
2026-08-25 13:42                   ` Lorenzo Stoakes (ARM)
2026-08-25 14:08                     ` Jann Horn
2026-08-25 14:24                       ` Lorenzo Stoakes (ARM)
2026-08-25 15:00                         ` Jann Horn
2026-08-26 13:05                           ` Lorenzo Stoakes (ARM)
2026-08-21 19:00   ` Lorenzo Stoakes (ARM)
2026-08-24 17:28     ` Jann Horn
2026-08-25 14:02       ` Lorenzo Stoakes (ARM)
2026-08-25 13:13   ` Christian Brauner
2026-08-25 13:46     ` Jann Horn
2026-08-26 10:26       ` Christian Brauner
2026-08-25 13:19   ` Christian Brauner
2026-08-25 14:00     ` Jann Horn
2026-08-26 10:29       ` Christian Brauner
2026-08-26 13:01         ` Christian Brauner
2026-08-26 16:17           ` Jann Horn
2026-08-18 19:51 ` [PATCH 3/3] selinux: require EXECMEM or PTRACE for FOLL_FORCE introspection Jann Horn
2026-08-18 19:58   ` sashiko-bot
2026-08-19 14:54   ` Stephen Smalley
2026-08-20 15:23     ` Jann Horn
2026-08-21 13:52       ` Stephen Smalley
2026-08-21 15:07         ` Jann Horn
2026-08-21 18:56   ` Lorenzo Stoakes (ARM)
2026-08-24 17:17     ` Jann Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260818200009.C2C3E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox