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 2/2] selinux: reject a class permission count below its inherited common
Date: Thu, 30 Jul 2026 16:14:48 -0400 [thread overview]
Message-ID: <0e717a3fd2a6e59b91aa4d15efde7caf@paul-moore.com> (raw)
In-Reply-To: <20260727-b4-disp-eed1276a-v2-2-82d58cf5f882@proton.me>
On Jul 27, 2026 Bryam Vargas <hexlabsecurity@proton.me> wrote:
>
> security_get_permissions() maps an inherited common's permissions into
> an array sized by the class's own permissions.nprim, but class_read()
> takes that nprim verbatim from the policy image and never checks that it
> covers the common. A class that inherits a common of N permissions while
> declaring a smaller nprim is accepted, and on load the common's
> permissions are written past the class-sized array -- an out-of-bounds
> heap write.
>
> Reject a class whose permission count is below its inherited common's.
> Well-formed policies, where the class count already includes the
> inherited permissions, 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 | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
Merged into selinux/stable-7.2, thanks!
--
paul-moore.com
prev parent 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
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 [this message]
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=0e717a3fd2a6e59b91aa4d15efde7caf@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
Powered by JetHome