From: Chris Wright <chrisw@osdl.org>
To: David Howells <dhowells@redhat.com>
Cc: Chris Wright <chrisw@osdl.org>,
torvalds@osdl.org, akpm@osdl.org, keyrings@linux-nfs.org,
linux-kernel@vger.kernel.org
Subject: Re: [Keyrings] [PATCH] Keys: Add LSM hooks for key management
Date: Fri, 7 Oct 2005 12:36:41 -0700 [thread overview]
Message-ID: <20051007193641.GT16352@shell0.pdx.osdl.net> (raw)
In-Reply-To: <23041.1128679024@warthog.cambridge.redhat.com>
* David Howells (dhowells@redhat.com) wrote:
> Chris Wright <chrisw@osdl.org> wrote:
>
> > BTW, /proc/keys should move, esp since it's a debugging interface.
>
> Move where? Actually, it shouldn't exist, except that I need it for debugging.
Debugfs is logical spot.
> > It means the security modules have to be able to parse the data. I
> > think that'd be the rough analog to updating file label based on file
> > contents, right? And we definitely don't want that.
>
> Okay, I'll not do that then.
>
> > So this security information is COW?
>
> That's a good point. I need to add a duplicate hook so that the LSM can copy
> or whatever the security information. Or maybe I should get rid of key
> duplication entirely since it's not available to userspace.
Yes, that's what I was trying to get at.
> > > The problem is that key_ref_t isn't available if CONFIG_KEYS is not defined,
> > > but it's still referenced in security.h. Would it be reasonable to make all
> > > the security_key_*() functions contingent on CONFIG_KEYS since they're only
> > > called from the key management code? That would mean I wouldn't need to do
> > > this.
> >
> > I see. I thought they already were conditional on CONFIG_KEYS.
>
> No... You get either one set which works or another set which is a bunch of
> dummy functions, not neither. I should change that. I could ditch the
> security_*() stubs entirely; they're just magic fluff to appease those who
> feel queasy at the sight of #ifdefs in .c files.
Typically forward decl is enough, it's just that typedef that's
problematic. But, it's not an issue, I was just clarifying that it
wasn't a core part of the patch, rather prep work.
> > So this is where 'rka->context = current' is established. And since
> > call_usermodehelper is called with wait flag set, you're sure current
> > won't go away...OK scratch that worry of mine.
>
> Even if that context could go away (say we made it request_key()
> interruptible), the authorisation key would be revoked _first_ with the key
> semaphore held, just to make sure there wouldn't be a race.
I was looking for places where rka->context is referrenced assuming it
didn't go away (i.e. Oops waiting to happen). Given the non-interrupitble
wait, this isn't possible.
> > Ah, I saw that code and didn't grok why that bit was needed, thanks.
>
> I should wrap this outline up and stick it in a document somewhere.
That's a good idea. I do appreciate the nice explanation.
> > > At some point, I will have to make it so that I don't have to use
> > > /sbin/request-key, but can instead request an already running daemon assume
> > > the context from an auth key specified to it, say by passing the key serial
> > > number over a socket.
> >
> > I can see the appeal, but actually current architecture makes it easier
> > to do checks against the caller that initiated the request.
>
> It's going to be necessary. I've had requests for this from Trond (NFSv4)
> amongst others. We discussed it at OLS; it really slows things down to be
> forking off new processes regularly, so it needs to be done. I thought I
> should probably do the LSM patch first so I could then work out how to fit in
> with that - so there may be more key security hooks coming.
Hmm, so we'll need a way for it to assume an identity, label and all.
<snip>
> > You're right, somehow I thought it was newly introduced.
>
> Well, you (or someone) did comment on the bit of the patch where I removed it
> from the header file...
Hehe, it was me, I blame overexposure to diapers ;-)
thanks,
-chris
next prev parent reply other threads:[~2005-10-07 19:36 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-05 16:28 [PATCH] Keys: Add LSM hooks for key management David Howells
2005-10-05 16:44 ` [Keyrings] " James Morris
2005-10-05 16:48 ` David Howells
2005-10-05 19:31 ` James Morris
2005-10-05 18:40 ` serue
2005-10-05 21:10 ` [Keyrings] " Chris Wright
2005-10-06 8:03 ` James Morris
2005-10-06 10:54 ` David Howells
2005-10-06 15:04 ` James Morris
2005-10-06 15:18 ` David Howells
2005-10-06 16:02 ` James Morris
2005-10-07 8:50 ` David Howells
2005-10-07 18:36 ` Chris Wright
2005-10-06 17:58 ` Chris Wright
2005-10-07 9:10 ` David Howells
2005-10-07 12:59 ` Stephen Smalley
2005-10-07 18:51 ` Chris Wright
2005-10-06 10:30 ` David Howells
2005-10-06 23:10 ` Chris Wright
2005-10-07 9:57 ` David Howells
2005-10-07 19:36 ` Chris Wright [this message]
2005-10-06 8:38 ` James Morris
2005-10-06 11:06 ` David Howells
2005-10-06 14:25 ` James Morris
2005-10-06 15:11 ` David Howells
2005-10-06 16:14 ` James Morris
2005-10-07 9:03 ` David Howells
2005-10-07 14:05 ` James Morris
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=20051007193641.GT16352@shell0.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=akpm@osdl.org \
--cc=dhowells@redhat.com \
--cc=keyrings@linux-nfs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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