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 1/4] selinux: do not cancel a policy conversion that never  started
Date: Mon, 03 Aug 2026 16:03:43 -0400	[thread overview]
Message-ID: <2c8fd481b3855784165a43b2174d4652@paul-moore.com> (raw)
In-Reply-To: <20260731-b4-disp-d32e997b-v1-1-0341d038ee47@proton.me>

On Jul 31, 2026 Bryam Vargas <hexlabsecurity@proton.me> wrote:
> 
> sel_write_load() calls selinux_policy_cancel() when sel_make_policy_nodes()
> fails, and that helper dereferences the outgoing policy to cancel its
> sidtab conversion. On the first policy load there is no outgoing policy:
> security_load_policy() returns early for that case, before it converts
> anything, and state->policy is still NULL. A first load that fails while
> building the selinuxfs tree therefore takes a NULL dereference in
> selinux_policy_cancel(), reached from a write(2) to /sys/fs/selinux/load.
> 
> Skip the cancel when there is no old policy, mirroring the check
> security_load_policy() already makes before it converts.
> 
> Fixes: 02a52c5c8c3b ("selinux: move policy commit after updating selinuxfs")
> 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/services.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

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 [this message]
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

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=2c8fd481b3855784165a43b2174d4652@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