linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Ondrej Mosnacek <omosnace@redhat.com>
Cc: Tyler Hicks <tyhicks@linux.microsoft.com>,
	Stephen Smalley <stephen.smalley.work@gmail.com>,
	SElinux list <selinux@vger.kernel.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] Race between policy reload sidtab conversion and live conversion
Date: Mon, 1 Mar 2021 09:46:39 -0500	[thread overview]
Message-ID: <CAHC9VhQ_oS-uGxhWBOCf3QBLpKD2_0--9nFOqANL1ykfbaA3Jw@mail.gmail.com> (raw)
In-Reply-To: <CAFqZXNufVGD0Sf-K3dKFmJyDOKGPg5jdJ_FPbQz__T8jAHhgYw@mail.gmail.com>

On Mon, Mar 1, 2021 at 5:36 AM Ondrej Mosnacek <omosnace@redhat.com> wrote:
> On Sun, Feb 28, 2021 at 8:21 PM Paul Moore <paul@paul-moore.com> wrote:
> > On Fri, Feb 26, 2021 at 6:12 AM Ondrej Mosnacek <omosnace@redhat.com> wrote:
> > > On Fri, Feb 26, 2021 at 2:07 AM Paul Moore <paul@paul-moore.com> wrote:
> > > > On Wed, Feb 24, 2021 at 4:35 AM Ondrej Mosnacek <omosnace@redhat.com> wrote:

...

> > Ah, yes, you're right.  I was only thinking about the problem of
> > adding an entry to the old sidtab, and not the (much more likely case)
> > of an entry being added to the new sidtab.  Bummer.
> >
> > Thinking aloud for a moment - what if we simply refused to add new
> > sidtab entries if the task's sidtab pointer is "old"?  Common sense
> > would tell us that this scenario should be very rare at present, and I
> > believe the testing mentioned in this thread adds some weight to that
> > claim.  After all, this only affects tasks which entered into their
> > RCU protected session prior to the policy load RCU sync *AND* are
> > attempting to add a new entry to the sidtab.  That *has* to be a
> > really low percentage, especially on a system that has been up and
> > running for some time.  My gut feeling is this should be safe as well;
> > all of the calling code should have the necessary error handling in
> > place as there are plenty of reasons why we could normally fail to add
> > an entry to the sidtab; memory allocation failures being the most
> > obvious failure point I would suspect.  This obvious downside to such
> > an approach is that those operations which do meet this criteria would
> > fail - and we should likely emit an error in this case - but is this
> > failure really worse than any other transient kernel failure,
>
> No, I don't like this approach at all. Before the sidtab refactor, it
> had been done exactly this way ...

I recognize I probably haven't made my feelings about reverts clear,
or if I have, I haven't done so recently.  Let me fix that now: I
*hate* them.  Further I hate reverts with a deep, passionate hatred
that I reserve for very few things.  Maybe we have to revert this
change, even though I *hate* reverts they do remain an option; you
just need to be 99% sure you've exhausted all the other options first.

> Perhaps it wasn't clear from what I wrote, but I certainly don't want
> to abandon it completely. Just to revert to a safe state until we
> figure out how to do the RCU policy reload safely. The solution with
> two-way conversion seems doable, it's just not a quick and easy fix.

I suggest pursuing this before the revert to see what it looks like
and we can discuss it further during review.

-- 
paul moore
www.paul-moore.com

  reply	other threads:[~2021-03-01 14:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 21:43 [BUG] Race between policy reload sidtab conversion and live conversion Tyler Hicks
2021-02-23 21:50 ` Tyler Hicks
2021-02-23 22:36   ` Tyler Hicks
2021-02-24  0:02     ` Paul Moore
2021-02-24  9:33     ` Ondrej Mosnacek
2021-02-24 14:36       ` Tyler Hicks
2021-02-25 16:38         ` Ondrej Mosnacek
2021-02-25 16:45           ` Tyler Hicks
2021-02-25 23:27           ` Paul Moore
2021-02-26  1:06       ` Paul Moore
2021-02-26 11:11         ` Ondrej Mosnacek
2021-02-28 19:21           ` Paul Moore
2021-03-01 10:35             ` Ondrej Mosnacek
2021-03-01 14:46               ` Paul Moore [this message]
     [not found]         ` <20210226040542.1137-1-hdanton@sina.com>
2021-02-26 11:19           ` Ondrej Mosnacek
     [not found]             ` <20210227023524.15844-1-hdanton@sina.com>
2021-03-01 14:35               ` Ondrej Mosnacek

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=CAHC9VhQ_oS-uGxhWBOCf3QBLpKD2_0--9nFOqANL1ykfbaA3Jw@mail.gmail.com \
    --to=paul@paul-moore.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=omosnace@redhat.com \
    --cc=selinux@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    --cc=tyhicks@linux.microsoft.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;
as well as URLs for NNTP newsgroup(s).