linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Stephen Smalley <sds@tycho.nsa.gov>,
	James Morris <jmorris@namei.org>,
	Paul Moore <paul@paul-moore.com>
Cc: LSM <linux-security-module@vger.kernel.org>
Subject: Re: New LSM hooks
Date: Wed, 6 Feb 2019 10:18:12 -0800	[thread overview]
Message-ID: <9042828c-841d-6c19-e102-12358317c79a@schaufler-ca.com> (raw)
In-Reply-To: <bd373344-fdfe-ff58-ff06-3b36df623648@tycho.nsa.gov>

On 2/6/2019 9:44 AM, Stephen Smalley wrote:
> On 2/6/19 12:24 PM, Casey Schaufler wrote:
>> On 2/6/2019 5:20 AM, Stephen Smalley wrote:
>>> On 2/5/19 8:11 PM, James Morris wrote:
>>>> On Tue, 5 Feb 2019, Paul Moore wrote:
>>>>
>>>>> I believe that will always be a problem, no matter what we do.  The
>>>>> point I was trying to make was that everyone, especially the
>>>>> maintainers, need to watch for this when patches are posted and make
>>>>> sure the patch author posts to the LSM list in addition to any of the
>>>>> relevant LSM specific lists.
>>>>
>>>> Right, and there is no way a new LSM hook should ever be added to the
>>>> kernel without review and ack/signoffs from folks on the LSM list
>>>> (especially those who are maintainers of in-tree LSMs).
>>>>
>>>> Casey, do you have any examples of this happening?
>>>
>>> Most of the times I've seen that it has come from vfs folks or other subsystems as part of some major reworking of that subsystem rather than from security module developers, e.g. the mount hooks overhaul.
>>
>> David Howells did contact me directly on the mount hook
>> changes well in advance. I'm more concerned with special
>> purpose hooks like we have for binder, kernfs, nfs, tun,
>> Infiniband and bpf. I'm not saying that we never need to
>> provide hooks with a single user, but you do have to
>> wonder about security_ismaclabel().
>
> binder is an IPC mechanism, so just like all the other IPC mechanisms, we needed hooks to mediate it.  No different than having hooks for System V IPC or Unix sockets. If LSM were a proper abstraction layer like the Flask architecture or even the BSD MAC framework, then we'd have some general purpose access control interface with a small number of entrypoints to invoke, but instead we just push all of that behind the LSM interface.  I wasn't an advocate for the LSM approach at the time but it is what was adopted and we have to live with it.

I didn't get what I wanted, either.

>
> kernfs doesn't follow the usual rules for inode setup, so we have to play by its rules. Not our choice to make, and there is a reason why kernfs is the way it is.

I don't believe that kernfs has to be as unusual as it is,
and should never have been included without working LSM
integration.

>
> NFSv4.2 chose to support MAC labels as a first class citizen rather than just xattrs (and there was a reason for that too), so we need a different path for getting and setting those labels.

And I *still* disagree with those reasons.

>
> And so on for tun, infiniband, and bpf.  Remember that LSM by design does nothing more than expose the kernel objects and operations to the security modules and leaves it up to the module writer to do everything else.

  reply	other threads:[~2019-02-06 18:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 17:40 New LSM hooks Casey Schaufler
2019-02-05 18:15 ` Paul Moore
2019-02-05 20:04   ` Casey Schaufler
2019-02-06  0:01     ` Paul Moore
2019-02-06  1:11       ` James Morris
2019-02-06 13:20         ` Stephen Smalley
2019-02-06 17:24           ` Casey Schaufler
2019-02-06 17:44             ` Stephen Smalley
2019-02-06 18:18               ` Casey Schaufler [this message]
2019-02-06 16:30         ` Casey Schaufler
2019-02-06 17:06           ` Stephen Smalley
2019-02-06 17:44             ` Casey Schaufler
2019-02-06 17:48               ` Stephen Smalley
2019-02-05 18:28 ` Edwin Zimmerman
2019-02-05 19:25   ` Casey Schaufler
2019-02-05 19:58     ` Paul Moore
2019-02-05 20:10     ` Edwin Zimmerman

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=9042828c-841d-6c19-e102-12358317c79a@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=jmorris@namei.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    /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).