All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Seth Forshee <seth.forshee@canonical.com>
Cc: Trond Myklebust <trondmy@primarydata.com>,
	"bfields\@fieldses.org" <bfields@fieldses.org>,
	"anna.schumaker\@netapp.com" <anna.schumaker@netapp.com>,
	"linux-nfs\@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] sunrpc: Use current_real_cred() when looking up rpc credentials
Date: Wed, 25 Jan 2017 12:28:36 +1300	[thread overview]
Message-ID: <87inp4rqaj.fsf@xmission.com> (raw)
In-Reply-To: <87efzsdq5b.fsf@xmission.com> (Eric W. Biederman's message of "Wed, 25 Jan 2017 11:55:28 +1300")


With respect to nfs and automounts.

Does NFS have different automount behavior based on the user
performing the automount?

If NFS does not have different automount behavior depending on the user
we just use the creds of the original mounter of NFS?

If NFS does have different automount behavior depending on the user
(ouch!) we need to go through the call path and see where it makes
sense to over ride things and where it does not.



Seth the fundamental problem with your patch was that you were patching
a location that is used for more just mounts.

I am strongly wishing that we could just change follow_automount from:


	old_cred = override_creds(&init_cred);
	mnt = path->dentry->d_op->d_automount(path);
	revert_creds(old_cred);

to:

	old_cred = override_creds(path->mnt->mnt_sb->s_cred);
	mnt = path->dentry->d_op->d_automount(path);
	revert_creds(old_cred);

And all will be well with nfs.  That does remain possible.

But looking at the code path you touched it seems to lookup the cred
based purely on the local uid, gid, and groups.  Which suggests to
me that even the original mounters creds may not be enough :(

At which point I am not certain of the solution.  But I fear that like
autofs NFS actually cares which user is transition the magic mountpoint,
and may return different data depending on who transitions the
mountpoint first.  Ick!  Nasty Nasty Ick!

Eric

  reply	other threads:[~2017-01-24 23:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 17:13 [PATCH] sunrpc: Use current_real_cred() when looking up rpc credentials Seth Forshee
2016-12-15 23:01 ` Trond Myklebust
2016-12-16 13:06   ` Seth Forshee
2017-01-10 14:55     ` Seth Forshee
2017-01-11  0:21       ` Eric W. Biederman
2017-01-24 15:17         ` Seth Forshee
2017-01-24 22:55           ` Eric W. Biederman
2017-01-24 23:28             ` Eric W. Biederman [this message]
2017-01-24 23:46               ` Trond Myklebust
2017-01-24 23:56                 ` Eric W. Biederman
2017-01-25  0:14                   ` Trond Myklebust
2017-01-25 14:52                     ` Seth Forshee
2017-01-25 15:51                       ` Trond Myklebust
2017-01-25 16:28                         ` Seth Forshee
2017-02-01  6:36                           ` Eric W. Biederman
2017-02-01  6:38                             ` [REVIEW][PATCH] fs: Better permission checking for submounts Eric W. Biederman
2017-02-01 13:28                               ` Trond Myklebust
2017-02-01 13:28                                 ` Trond Myklebust
2017-02-01 13:38                               ` Seth Forshee

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=87inp4rqaj.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=anna.schumaker@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=seth.forshee@canonical.com \
    --cc=trondmy@primarydata.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.