All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH v1] lsm: Set PF_SUPERPRIV only when all mmap_addr hooks allow a mapping
Date: Wed, 18 Nov 2026 17:03:31 +0000	[thread overview]
Message-ID: <sashiko-outbox-221575@kernel.org> (raw)
In-Reply-To: <20261118165603.2573289-1-mic@digikod.net>

> cap_mmap_addr() sets PF_SUPERPRIV when commoncap grants CAP_SYS_RAWIO
> for a mapping below vm.mmap_min_addr, before the other LSMs' mmap_addr
> hooks run.  If one of them then denies the mapping (e.g. SELinux's
> mmap_zero check), process accounting still reports a use of privileges.
> 
> Set the flag in security_mmap_addr() once all hooks allowed the mapping,
> as ns_capable() does after security_capable().  commoncap runs first and
> denies such a mapping without CAP_SYS_RAWIO, so a successful hook chain
> means that the capability was used.
> 
> Cc: Paul Moore <paul@paul-moore.com>
> Cc: Serge Hallyn <serge@hallyn.com>
> Cc: Stephen Smalley <stephen.smalley.work@gmail.com>
> Reported-by: Günther Noack <gnoack@google.com>
> Closes: https://patch.msgid.link/avxjfHybQBcATFKV@google.com
> Fixes: 9c0d90103c7e ("Capabilities: move cap_file_mmap to commoncap.c")
> Signed-off-by: Mickaël Salaün <mic@digikod.net>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118165603.2573289-1-mic@digikod.net?part=1


  reply	other threads:[~2026-11-18 17:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 16:56 [PATCH v1] lsm: Set PF_SUPERPRIV only when all mmap_addr hooks allow a mapping Mickaël Salaün
2026-11-18 17:03 ` sashiko-bot [this message]
2026-11-20 18:49 ` Serge E. Hallyn

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=sashiko-outbox-221575@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.