From: "Serge E. Hallyn" <serge@hallyn.com>
To: Jann Horn <jannh@google.com>
Cc: "Serge Hallyn (AMD)" <sergeh@kernel.org>,
"Paul Moore" <paul@paul-moore.com>,
"James Morris" <jmorris@namei.org>,
"Stephen Smalley" <stephen.smalley.work@gmail.com>,
"Jeff Xu" <jeffxu@google.com>,
"Thiébaud Weksteen" <tweek@google.com>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Christian Brauner" <brauner@kernel.org>,
"Jan Kara" <jack@suse.cz>,
linux-fsdevel@vger.kernel.org,
linux-security-module@vger.kernel.org,
"Ondrej Mosnacek" <omosnace@redhat.com>,
selinux@vger.kernel.org,
"Andrew Morton" <akpm@linux-foundation.org>,
"Liam R. Howlett" <liam@infradead.org>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Pedro Falcato" <pfalcato@suse.de>,
"David Hildenbrand" <david@kernel.org>,
linux-mm@kvack.org
Subject: Re: [PATCH v3 2/3] proc: query LSMs for introspective mem access (if PROC_MEM_FORCE_ALWAYS)
Date: Tue, 15 Sep 2026 12:53:54 -0500 [thread overview]
Message-ID: <aqmGMv8CtkCVmyNu@hallyn.com> (raw)
In-Reply-To: <CAG48ez3THXFA=jF_R-wRNsEA=BfD8X1=pHm7dtVnbOto+rXW3w@mail.gmail.com>
On Tue, Sep 15, 2026 at 07:44:23PM +0200, Jann Horn wrote:
> On Tue, Sep 15, 2026 at 7:04 PM Serge Hallyn (AMD) <sergeh@kernel.org> wrote:
> > On Mon, Sep 07, 2026 at 11:00:17PM +0200, Jann Horn wrote:
> > > +/**
> > > + * security_mem_foll_force() - Check if FOLL_FORCE is allowed
> > > + * @subject: credentials using which /proc/$pid/mem was opened
> > > + * @opened_by_owner: whether checks on open() were bypassed because the opener
> > > + * has the same MM as the target
> > > + *
> > > + * Check if FOLL_FORCE is allowed for accessing process memory through
> > > + * /proc/$pid/mem. opened_by_owner signals whether the opener's MM was the same
> > > + * as the target MM, meaning the security_ptrace_access_check() hook was
> > > + * bypassed on open().
> > > + * (Current current->mm does not matter for this; for example, if write() is
> > > + * called on an FD that was received from another process which obtained it with
> > > + * open("/proc/self/mem"), @opened_by_owner is still true.)
> > > + *
> > > + * Note that this hook is only designed to be useful in the opened_by_owner
> > > + * case, where the subject credentials effectively also describe the object.
> >
> > Given this, would it make more sense to call the hook something
> > like `security_mem_foll_force_self()` and only call it in the
> > opened_by_owner==true case?
> >
> > I only suggest it because it seems to lower the cognitive load
> > when looking at this code, so it might make it easier to maintain.
>
> I agree with you, and that is what I did in the previous versions. :P
>
> But given that two relevant maintainers disagreed with me, I changed
> it in this version.
Ah, I'm sorry. Didn't mean to dispute a prior decision.
Sounds good.
IIUC it's already in a tree, but for the record
Reviewed-by: Serge Hallyn <sergeh@kernel.org>
thanks,
-serge
next prev parent reply other threads:[~2026-09-15 18:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 21:00 [PATCH v3 0/3] proc,security,selinux: let SELinux block FOLL_FORCE for /proc/self/mem Jann Horn
2026-09-07 21:00 ` [PATCH v3 1/3] proc: refactor /proc/$pid/mem to use struct as private_data Jann Horn
2026-09-07 21:07 ` sashiko-bot
2026-09-07 21:00 ` [PATCH v3 2/3] proc: query LSMs for introspective mem access (if PROC_MEM_FORCE_ALWAYS) Jann Horn
2026-09-07 21:09 ` sashiko-bot
2026-09-15 17:04 ` Serge Hallyn (AMD)
2026-09-15 17:24 ` Paul Moore
2026-09-15 17:54 ` Serge E. Hallyn
2026-09-15 17:44 ` Jann Horn
2026-09-15 17:53 ` Serge E. Hallyn [this message]
2026-09-07 21:00 ` [PATCH v3 3/3] selinux: require PROCESS__PTRACE for FOLL_FORCE introspection Jann Horn
2026-09-07 21:08 ` sashiko-bot
2026-09-10 7:48 ` [PATCH v3 0/3] proc,security,selinux: let SELinux block FOLL_FORCE for /proc/self/mem Christian Brauner
2026-09-14 17:05 ` Paul Moore
2026-09-16 9:01 ` Christian Brauner
2026-09-16 14:33 ` Jann Horn
2026-09-21 2:33 ` Paul Moore
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=aqmGMv8CtkCVmyNu@hallyn.com \
--to=serge@hallyn.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=david@kernel.org \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=jeffxu@google.com \
--cc=jmorris@namei.org \
--cc=liam@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-security-module@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=pfalcato@suse.de \
--cc=selinux@vger.kernel.org \
--cc=sergeh@kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=tweek@google.com \
--cc=vbabka@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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