[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHC9VhTuurjpkgq=cS5ZNwpxuuOq4E3eE2RuD+JaCQz6X0fk6g@mail.gmail.com>
Date: Fri, 28 May 2021 11:54:05 -0400
From: Paul Moore <paul@...l-moore.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: Ondrej Mosnacek <omosnace@...hat.com>,
Linux Security Module list
<linux-security-module@...r.kernel.org>,
James Morris <jmorris@...ei.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
Stephen Smalley <stephen.smalley.work@...il.com>,
SElinux list <selinux@...r.kernel.org>,
linuxppc-dev@...ts.ozlabs.org,
Linux FS Devel <linux-fsdevel@...r.kernel.org>,
bpf <bpf@...r.kernel.org>, network dev <netdev@...r.kernel.org>,
Linux kernel mailing list <linux-kernel@...r.kernel.org>,
Casey Schaufler <casey@...aufler-ca.com>,
Jiri Olsa <jolsa@...hat.com>, andrii.nakryiko@...il.com
Subject: Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown
permission checks
On Fri, May 28, 2021 at 10:43 AM Daniel Borkmann <daniel@...earbox.net> wrote:
> On 5/28/21 3:42 PM, Ondrej Mosnacek wrote:
> > (I'm off work today and plan to reply also to Paul's comments next
> > week, but for now let me at least share a couple quick thoughts on
> > Daniel's patch.)
Oooh, I sense some disagreement brewing :)
> > On Fri, May 28, 2021 at 11:56 AM Daniel Borkmann <daniel@...earbox.net> wrote:
> >> On 5/28/21 9:09 AM, Daniel Borkmann wrote:
> >>> On 5/28/21 3:37 AM, Paul Moore wrote:
> >>>> On Mon, May 17, 2021 at 5:22 AM Ondrej Mosnacek <omosnace@...hat.com> wrote:
...
> >> Ondrej / Paul / Jiri: at least for the BPF tracing case specifically (I haven't looked
> >> at the rest but it's also kind of independent), the attached fix should address both
> >> reported issues, please take a look & test.
> >
> > Thanks, I like this solution, although there are a few gotchas:
> >
> > 1. This patch creates a slight "regression" in that if someone flips
> > the Lockdown LSM into lockdown mode on runtime, existing (already
> > loaded) BPF programs will still be able to call the
> > confidentiality-breaching helpers, while before the lockdown would
> > apply also to them. Personally, I don't think it's a big deal (and I
> > bet there are other existing cases where some handle kept from before
> > lockdown could leak data), but I wanted to mention it in case someone
> > thinks the opposite.
>
> Yes, right, though this is nothing new either in the sense that there are
> plenty of other cases with security_locked_down() that operate this way
> e.g. take the open_kcore() for /proc/kcore access or the module_sig_check()
> for mod signatures just to pick some random ones, same approach where the
> enforcement is happen at open/load time.
Another, yes, this is not really a good thing to do. Also, just
because there are other places that don't really do The Right Thing
doesn't mean that it is okay to also not do The Right Thing here.
It's basically the two-wrongs-don't-make-a-right issue applied to
kernel code.
--
paul moore
www.paul-moore.com
Powered by blists - more mailing lists