Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jeff.layton@primarydata.com>
Cc: "Ian Kent" <ikent@redhat.com>,
	"Benjamin Coddington" <bcodding@redhat.com>,
	"David Howells" <dhowells@redhat.com>,
	"David Härdeman" <david@hardeman.nu>,
	linux-nfs@vger.kernel.org, SteveD@redhat.com, idra@samba.org
Subject: Re: [PATCH 00/19] gssd improvements
Date: Thu, 11 Dec 2014 15:38:41 -0500	[thread overview]
Message-ID: <20141211203841.GQ20526@fieldses.org> (raw)
In-Reply-To: <20141211151135.6ba88835@tlielax.poochiereds.net>

On Thu, Dec 11, 2014 at 03:11:35PM -0500, Jeff Layton wrote:
> On Thu, 11 Dec 2014 14:55:27 -0500
> "J. Bruce Fields" <bfields@fieldses.org> wrote:
> 
> > On Thu, Dec 11, 2014 at 02:50:29PM -0500, Jeff Layton wrote:
> > > On Thu, 11 Dec 2014 14:32:40 -0500
> > > "J. Bruce Fields" <bfields@fieldses.org> wrote:
> > > 
> > > > On Thu, Dec 11, 2014 at 06:45:37AM -0500, Jeff Layton wrote:
> > > > > For instance: module loading clearly needs to be done in the "context"
> > > > > of the canonical root init process. That's what call_usermodehelper was
> > > > > originally used for so we need to keep that ability intact.
> > > > > 
> > > > > OTOH, keyring upcalls probably ought to be done in the context of the
> > > > > task that triggered them. Certainly we ought to be spawning them with
> > > > > the credentials associated with the keyring.
> > > > 
> > > > Isn't the idmapping done as a keyring upcall?  You don't want ordinary
> > > > users of the filesystem to be able to pollute the id<->name cache.
> > > > 
> > > 
> > > Yes, it is done as a keyring upcall. You wouldn't need to allow random
> > > users to pollute the cache. When you do a keys upcall the process gets
> > > an authorization key that allows it to instantiate the key.
> > > 
> > > AFAIU, that's what guards against random processes polluting the
> > > keyring, not any particular capabilities or anything.
> > 
> > That doesn't stop it from instantiating the key with the wrong
> > information.
> > 
> 
> I guess I'm unclear on the attack vector you're talking about. The
> difference is the credentials that we give the process when its run by
> call_usermodehelper. Why would it be inherently more secure for that to
> be given root credentials rather than something non-privileged?
> 
> The only way you can add keys to a keyring you don't own is to have an
> authorization key, and that would only be given to the process that got
> spawned by the kernel.

OK.  I was interpreting "keyring upcalls probably out to be done in the
context of the task that triggered them" to mean they should be done
with all the various namespaces of that task, which would among other
things give unprivileged users control over the mapping.

> > > > And in the gssd case, userland doesn't just find the right cred, it also
> > > > does the rpcsec_gss context setup with the server.  A random user of the
> > > > filesystem might not be able to do that part.
> > > > 
> > > 
> > > I don't see why not. We already do that today as an unprivileged user
> > > in gssd. process_krb5_upcall forks and changes identity before getting
> > > a ticket and setting up the context and then handing that back to the
> > > kernel. I don't think that requires any special privileges.
> > 
> > Why couldn't you give a task access to an nfs filesystem but wall it off
> > in a network namespace where it doesn't even have access to the
> > interface that the mount was done over?
> > 
> 
> That's a pathological case. ;) I suppose you could do that, at which
> point you'd be screwed. That's the unfortunate side of having all of
> these disconnected types of namespaces. You can use these Lego bricks
> to build something either awesome or completely non-functional. I don't
> think we can really solve all possible use-cases since some of them are
> non-sensical anyway. I think all we can do is target the use-cases that
> we think make sense and take it from there.

I think it's pretty normal to sandbox tasks to deny them network access,
and I wouldn't expect that to mean giving up access to mounted nfs
filesystems.

> While we're on the subject, having the userland process establish the
> GSS context over an entirely separate connection is a hack anyway. We
> really ought to be doing that using the same connection. Simo had some
> arguments against that scheme a while back, but I don't recall the
> details -- seems like maybe it breaks channel bindings? While we're
> talking about rejiggering all of this, that would be a good thing to
> change as well.

It was Simo that wanted to move the context establishment into kernel
sunrpc code and Trond that objected to that.  And yes one of the only
practical differences we could come up with is that having it in the
kernel and sharing the same connection would allow channel bindings.
But nobody seems to care about channel bindings for now.

It's a long-running argument--the first gssd prototypes basically did
gssapi over rpc (a little like gssproxy) and it was Trond that wanted
the whole negotiation done in userspace.

--b.

> > (And similarly what's to guarantee that a user of the filesystem is
> > capable of doing the ldap calls you might need for idmapping?)
> > 
> 
> Yeah, that certainly could be a problem. I'm not sure we'd really want
> to do the idmapping upcalls as the user that triggered them in the case
> of the idmapper. Perhaps there ought to be a specific set of
> credentials associated with the keyring that the idmapper uses instead?
> Those don't necessarily need to be root creds of course.

  reply	other threads:[~2014-12-11 20:38 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09  5:40 [PATCH 00/19] gssd improvements David Härdeman
2014-12-09  5:40 ` [PATCH 01/19] nfs-utils: cleanup daemonization code David Härdeman
2014-12-09  5:40 ` [PATCH 02/19] nfs-utils: gssd - merge gssd_main_loop.c and gssd.c David Härdeman
2014-12-09  5:40 ` [PATCH 03/19] nfs-utils: gssd - simplify some option handling David Härdeman
2014-12-09  5:41 ` [PATCH 04/19] nfs-utils: gssd - remove arbitrary GSSD_MAX_CCACHE_SEARCH limitation David Härdeman
2014-12-09  5:41 ` [PATCH 05/19] nfs-utils: gssd - simplify topdirs path David Härdeman
2014-12-09  5:41 ` [PATCH 06/19] nfs-utils: gssd - move over pipfs scanning code David Härdeman
2014-12-09  5:41 ` [PATCH 07/19] nfs-utils: gssd - simplify client dir " David Härdeman
2014-12-09  5:41 ` [PATCH 08/19] nfs-utils: gssd - use libevent David Härdeman
2014-12-09  5:41 ` [PATCH 09/19] nfs-utils: gssd - remove "close me" code David Härdeman
2014-12-09  5:41 ` [PATCH 10/19] nfs-utils: gssd - make the client lists per-topdir David Härdeman
2014-12-09  5:41 ` [PATCH 11/19] nfs-utils: gssd - keep the rpc_pipefs dir open David Härdeman
2014-12-09  5:41 ` [PATCH 12/19] nfs-utils: gssd - use more relative paths David Härdeman
2014-12-09  5:41 ` [PATCH 13/19] nfs-utils: gssd - simplify topdir scanning David Härdeman
2014-12-09  5:41 ` [PATCH 14/19] nfs-utils: gssd - simplify client scanning David Härdeman
2014-12-09  5:41 ` [PATCH 15/19] nfs-utils: gssd - cleanup read_service_info David Härdeman
2014-12-09  5:42 ` [PATCH 16/19] nfs-utils: gssd - change dnotify to inotify David Härdeman
2014-12-09  5:42 ` [PATCH 17/19] nfs-utils: gssd - further shorten some pathnames David Härdeman
2014-12-09  5:42 ` [PATCH 18/19] nfs-utils: gssd - improve inotify David Härdeman
2014-12-09  5:42 ` [PATCH 19/19] nfs-utils: gssd - simplify handle_gssd_upcall David Härdeman
2014-12-09 13:09 ` [PATCH 00/19] gssd improvements Jeff Layton
2014-12-09 13:52   ` David Härdeman
2014-12-09 14:58     ` Jeff Layton
2014-12-09 15:07       ` Simo Sorce
2014-12-09 19:55       ` David Härdeman
2014-12-10 11:52         ` Jeff Layton
2014-12-10 14:08           ` David Härdeman
2014-12-10 14:17             ` Jeff Layton
2014-12-10 14:31               ` David Härdeman
2014-12-10 14:34                 ` Jeff Layton
2014-12-10 16:03                   ` David Howells
2014-12-10 19:03                     ` Jeff Layton
2014-12-10 20:55                       ` David Härdeman
2014-12-10 23:44                       ` Ian Kent
2014-12-10 23:21                     ` Benjamin Coddington
2014-12-11  0:12                       ` Ian Kent
2014-12-11  1:54                         ` Benjamin Coddington
2014-12-11  3:21                           ` Ian Kent
2014-12-11 11:45                             ` Jeff Layton
2014-12-11 12:55                               ` Ian Kent
2014-12-11 13:46                                 ` Jeff Layton
2014-12-11 22:31                                   ` Ian Kent
2014-12-11 19:32                               ` J. Bruce Fields
2014-12-11 19:50                                 ` Jeff Layton
2014-12-11 19:55                                   ` J. Bruce Fields
2014-12-11 20:11                                     ` Jeff Layton
2014-12-11 20:38                                       ` J. Bruce Fields [this message]
2014-12-11 22:20                                         ` Ian Kent
2014-12-09 16:39 ` Steve Dickson
2014-12-09 20:22   ` David Härdeman
2014-12-09 21:13     ` Steve Dickson
2014-12-10 14:20       ` David Härdeman
2014-12-10 20:35 ` J. Bruce Fields
2014-12-10 20:49   ` David Härdeman
2014-12-10 21:07     ` J. Bruce Fields
2015-01-28 21:29 ` Steve Dickson

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=20141211203841.GQ20526@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=SteveD@redhat.com \
    --cc=bcodding@redhat.com \
    --cc=david@hardeman.nu \
    --cc=dhowells@redhat.com \
    --cc=idra@samba.org \
    --cc=ikent@redhat.com \
    --cc=jeff.layton@primarydata.com \
    --cc=linux-nfs@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