mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Bryam Vargas <hexlabsecurity@proton.me>,
	Stephen Smalley <stephen.smalley.work@gmail.com>
Cc: "Kees Cook" <kees@kernel.org>,
	"Ondrej Mosnacek" <omosnace@redhat.com>,
	"Christian Göttsche" <cgzones@googlemail.com>,
	selinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] selinux: reject a permission value exceeding the  class permission count
Date: Thu, 30 Jul 2026 16:14:46 -0400	[thread overview]
Message-ID: <d6fd17490c9c229998f1d553da088433@paul-moore.com> (raw)
In-Reply-To: <20260727-b4-disp-eed1276a-v2-1-82d58cf5f882@proton.me>

On Jul 27, 2026 Bryam Vargas <hexlabsecurity@proton.me> wrote:
> 
> perm_read() bounds a permission value by SEL_VEC_MAX but never by the
> nprim of the owning class or common, which is taken verbatim from the
> policy image.  security_get_permissions() then writes perms[value - 1]
> into an nprim-sized kcalloc() array, so a class declaring fewer
> permissions than its largest permission value drives an out-of-bounds
> heap write.  The top-level symbol tables are validated this way; the
> nested per-class permission table is not.
> 
> Reject a permission whose value exceeds nprim, which is already set when
> perm_read() runs.  Well-formed policies are unaffected.
> 
> Fixes: 55fcf09b3fe4 ("selinux: add support for querying object classes and permissions from the running policy")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
> Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> ---
>  security/selinux/ss/policydb.c | 3 +++
>  1 file changed, 3 insertions(+)

Merged into selinux/stable-7.2, thanks!

--
paul-moore.com

  reply	other threads:[~2026-07-30 20:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28  1:30 [PATCH v2 0/2] selinux: bound class/common permission counts on policy load Bryam Vargas via B4 Relay
2026-07-28  1:30 ` [PATCH v2 1/2] selinux: reject a permission value exceeding the class permission count Bryam Vargas via B4 Relay
2026-07-30 20:14   ` Paul Moore [this message]
2026-07-28  1:30 ` [PATCH v2 2/2] selinux: reject a class permission count below its inherited common Bryam Vargas via B4 Relay
2026-07-28 14:43   ` Stephen Smalley
2026-07-28 17:42     ` Bryam Vargas
2026-07-30 20:24       ` Paul Moore
2026-07-30 20:14   ` 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=d6fd17490c9c229998f1d553da088433@paul-moore.com \
    --to=paul@paul-moore.com \
    --cc=cgzones@googlemail.com \
    --cc=hexlabsecurity@proton.me \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=omosnace@redhat.com \
    --cc=selinux@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    /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

all inboxes | Powered by JetHome®