The Linux Kernel Mailing List
 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: linux-kernel@vger.kernel.org,
	"Ondrej Mosnacek" <omosnace@redhat.com>,
	"Kees Cook" <kees@kernel.org>,
	selinux@vger.kernel.org,
	"Christian Göttsche" <cgzones@googlemail.com>
Subject: Re: [PATCH 4/4] selinux: require every boolean value to be defined
Date: Mon, 03 Aug 2026 16:03:52 -0400	[thread overview]
Message-ID: <f07bba9a6608ce54879149d91c152e1f@paul-moore.com> (raw)
In-Reply-To: <20260731-b4-disp-d32e997b-v1-4-0341d038ee47@proton.me>

On Jul 31, 2026 Bryam Vargas <hexlabsecurity@proton.me> wrote:
> 
> p_bools.nprim comes from the policy image independently of how many
> booleans follow it, and cond_index_bool() fills bool_val_to_struct[] at
> value - 1, so a count larger than the values present leaves NULL entries.
> Every user of that array then walks it by index and dereferences each
> entry: cond_evaluate_expr() on the access-vector path,
> security_get_bools() and security_get_bool_value() behind selinuxfs, and
> security_set_bools(). A sparse class value is absorbed by
> policydb_class_isvalid() and its siblings; booleans have no such
> predicate, and no consumer that could use one.
> 
> Reject a boolean value that no boolean defines, once, where the array is
> built. Conforming policies define every boolean they declare and are
> unaffected.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> 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 | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Merged into selinux/stable-7.2, thanks!

--
paul-moore.com

      parent reply	other threads:[~2026-08-03 20:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 17:44 [PATCH 0/4] selinux: make declared counts account for the values Bryam Vargas via B4 Relay
2026-07-31 17:44 ` [PATCH 1/4] selinux: do not cancel a policy conversion that never started Bryam Vargas via B4 Relay
2026-07-31 19:40   ` Stephen Smalley
2026-08-03 20:03   ` Paul Moore
2026-07-31 17:44 ` [PATCH 2/4] selinux: require a class's permission values to cover its permission count Bryam Vargas via B4 Relay
2026-07-31 19:44   ` Stephen Smalley
2026-08-03 20:03   ` Paul Moore
2026-07-31 17:44 ` [PATCH 3/4] selinux: reject an unclaimed class value in security_get_classes() Bryam Vargas via B4 Relay
2026-07-31 19:46   ` Stephen Smalley
2026-08-03 20:03   ` Paul Moore
2026-07-31 17:44 ` [PATCH 4/4] selinux: require every boolean value to be defined Bryam Vargas via B4 Relay
2026-08-03 12:22   ` Stephen Smalley
2026-08-03 20:03   ` 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=f07bba9a6608ce54879149d91c152e1f@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