SELinux Archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: "Christian Göttsche" <cgoettsche@seltendoof.de>, selinux@vger.kernel.org
Cc: "Christian Göttsche" <cgzones@googlemail.com>
Subject: Re: [PATCH v2] selinux: pre-allocate the status page
Date: Tue, 30 Apr 2024 17:50:54 -0400	[thread overview]
Message-ID: <bbf99ca20884fa6e549cb699fd6269da@paul-moore.com> (raw)
In-Reply-To: <20240405155033.249321-1-cgoettsche@seltendoof.de>

On Apr  5, 2024 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgoettsche@seltendoof.de> wrote:
> 
> Since the status page is currently only allocated on first use, the
> sequence number of the initial policyload (i.e. 1) is not stored,
> leading to the observable sequence of 0, 2, 3, 4, ...
> 
> Try to pre-allocate the status page during the initialization of the
> selinuxfs, so selinux_status_update_policyload() will set the sequence
> number.
> 
> This brings the status page to return the actual sequence number for the
> initial policy load, which is also observable via the netlink socket.
> I could not find any occurrence where userspace depends on the actual
> value returned by selinux_status_policyload(3), thus the breakage should
> be unnoticed.
> 
> Reported-by: Milos Malik
> Closes: https://lore.kernel.org/selinux/87o7fmua12.fsf@redhat.com/
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> ---
> v2: ignore allocation failure
> ---
>  security/selinux/selinuxfs.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Thanks Christian.  I trimmed out the 'Reported-by:' tag since there
wasn't an email listed and I wasn't sure if that would cause problems
with any tooling that digs through the git log (checkpatch.pl did
complain).  If any of the IBM/RH folks want to check with Milos and
make sure it is okay with him I'll re-add him to the commit metadata.

Merged into selinux/dev.

--
paul-moore.com

      reply	other threads:[~2024-04-30 21:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 15:50 [PATCH v2] selinux: pre-allocate the status page Christian Göttsche
2024-04-30 21:50 ` 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=bbf99ca20884fa6e549cb699fd6269da@paul-moore.com \
    --to=paul@paul-moore.com \
    --cc=cgoettsche@seltendoof.de \
    --cc=cgzones@googlemail.com \
    --cc=selinux@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).