All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sunrpc: Use current_real_cred() when looking up rpc credentials
@ 2016-12-15 17:13 Seth Forshee
  2016-12-15 23:01 ` Trond Myklebust
  0 siblings, 1 reply; 19+ messages in thread
From: Seth Forshee @ 2016-12-15 17:13 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker, J. Bruce Fields
  Cc: Eric W . Biederman, linux-nfs

Since 4.8 follow_automount() overrides the credentials with
&init_cred before calling d_automount(). When
rpcauth_lookupcred() is called in this context it is now using
fs[ug]id from the override creds instead of from the user's
creds, which can cause authentication to fail. To fix this, take
the ids from current_real_cred() instead.

Cc: stable@vger.kernel.org # v4.8+
CC: Eric W. Biederman <ebiederm@xmission.com>
Fixes: aeaa4a79ff6a ("fs: Call d_automount with the filesystems creds")
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 net/sunrpc/auth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 2bff63a73cf8..e6197b2bda86 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -622,7 +622,7 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags)
 {
 	struct auth_cred acred;
 	struct rpc_cred *ret;
-	const struct cred *cred = current_cred();
+	const struct cred *cred = current_real_cred();
 
 	dprintk("RPC:       looking up %s cred\n",
 		auth->au_ops->au_name);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-02-01 13:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.