From: Paul Moore <paul@paul-moore.com>
To: Haoxiang Li <haoxiang_li2024@163.com>,
stephen.smalley.work@gmail.com, omosnace@redhat.com
Cc: selinux@vger.kernel.org, linux-kernel@vger.kernel.org,
Haoxiang Li <haoxiang_li2024@163.com>
Subject: Re: [PATCH] selinux: clean up selinuxfs resources on init failure
Date: Wed, 01 Jul 2026 17:17:40 -0400 [thread overview]
Message-ID: <b64e16449728cd72ed3968986f5ab166@paul-moore.com> (raw)
In-Reply-To: <20260622143722.1167703-1-haoxiang_li2024@163.com>
On Jun 22, 2026 Haoxiang Li <haoxiang_li2024@163.com> wrote:
>
> init_sel_fs() creates the selinuxfs mount point and registers the
> filesystem before mounting selinuxfs internally. If kern_mount()
> or the subsequent lookup of the null file fails, the function
> returns without undoing the resources that were already registered.
>
> Add the missing error unwinding so the internal mount, filesystem
> registration, and sysfs mount point are released as appropriate.
>
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> ---
> security/selinux/selinuxfs.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
As Stephen already pointed out, the cleanup isn't critical as the system
is going to fall over any die anyway, but it shouldn't hurt. Merged into
selinux/dev.
--
paul-moore.com
prev parent reply other threads:[~2026-07-01 21:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 14:37 Haoxiang Li
2026-06-22 19:45 ` Stephen Smalley
2026-07-01 21:17 ` 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=b64e16449728cd72ed3968986f5ab166@paul-moore.com \
--to=paul@paul-moore.com \
--cc=haoxiang_li2024@163.com \
--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®