All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Haoxiang Li <haoxiang_li2024@163.com>,
	stephen.smalley.work@gmail.com, omosnacek@gmail.com,
	cgzones@googlemail.com, hexlabsecurity@proton.me,
	jmorris@namei.org
Cc: selinux@vger.kernel.org, Haoxiang Li <haoxiang_li2024@163.com>
Subject: Re: [PATCH] selinux: Free MLS range category bitmaps on load failure
Date: Fri, 04 Dec 2026 12:29:31 -0500	[thread overview]
Message-ID: <63fafa6e13d713cec26f287be2e96046@paul-moore.com> (raw)
In-Reply-To: <20261204050408.1459808-1-haoxiang_li2024@163.com>

On Dec  4, 2026 Haoxiang Li <haoxiang_li2024@163.com> wrote:
> 
> After mls_read_range_helper() successfully initializes an MLS range,
> range validation or hash table insertion may fail. The error paths
> free the range structure without destroying its category bitmaps,
> leaking the allocated bitmap nodes.
> 
> Destroy both category bitmaps before freeing the range if validation
> or insertion fails.
> 
> Fixes: 2f3e82d694d3 ("selinux: convert range transition list to a hashtab")
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> ---
>  security/selinux/ss/policydb.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)

Merged into selinux/dev, thanks!

--
paul-moore.com

      parent reply	other threads:[~2026-12-04 17:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  5:04 [PATCH] selinux: Free MLS range category bitmaps on load failure Haoxiang Li
2026-12-04  5:09 ` sashiko-bot
2026-12-04 13:41 ` Stephen Smalley
2026-12-04 17:29 ` 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=63fafa6e13d713cec26f287be2e96046@paul-moore.com \
    --to=paul@paul-moore.com \
    --cc=cgzones@googlemail.com \
    --cc=haoxiang_li2024@163.com \
    --cc=hexlabsecurity@proton.me \
    --cc=jmorris@namei.org \
    --cc=omosnacek@gmail.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 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.