Skip to contentSkip to conversation

NFS: Fix SECINFO processing regression

PATCH New [email protected] 1 participant 2 messages Jun 12, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover NFS: Fix SECINFO processing regression

From: Andy Adamson <[email protected]>

Iterate over multiple flavors returned by SECINFO. If RPC_AUTH_GSS is in the secinfo list, fully test (get and auth, credential, and gss_context)

Fix some error paths.

Version 2:
- Responded to Trond's comments. Cloned an RPC client for each flavor to test which creates an rpc_auth. Use rpcauth_lookupcred() to create a cred for the user (and gss_context for gss).

- Removed nfs4_negotiate_security from nfs4_submount as is was just called from nfs4_proc_lookup_mountpoint.

Testing: Minimal testing of the nfs_test_gss_flavor. Will run more tests after the June 2014 bakeathon

Note: Can supply a patch for SECINFO_NO_name to use nfs4_negotiate_security.

-->Andy

Andy Adamson (3):
NFS check the return of nfs4_negotiate_security in nfs4_submount NFS Return -EPERM if no supported or matching SECINFO flavor NFS test SECINFO RPC_AUTH_GSS pseudoflavors for support

 fs/nfs/nfs4namespace.c | 66 +++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 55 insertions(+), 11 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/2 NFS NFS test SECINFO RPC_AUTH_GSS pseudoflavors for support

From: Andy Adamson <[email protected]>

Fix nfs4_negotiate_security to create an rpc_clnt used to test each SECINFO returned pseudoflavor. Check credential creation (and gss_context creation) which is important for RPC_AUTH_GSS pseudoflavors which can fail for multiple reasons including mis-configuration.

Don't call nfs4_negotiate in nfs4_submount as it was just called by nfs4_proc_lookup_mountpoint (nfs4_proc_lookup_common)

Conflicts:
fs/nfs/nfs4namespace.c

---
 fs/nfs/nfs4_fs.h       |   2 +-
 fs/nfs/nfs4namespace.c | 103 ++++++++++++++++++++++++++++---------------------
 fs/nfs/nfs4proc.c      |   2 +-
 net/sunrpc/auth.c      |   1 +
 4 files changed, 61 insertions(+), 47 deletions(-)
fs/nfs/nfs4_fs.h +1 -1
index f63cb87..ba2affa 100644
@@ -230,7 +230,7 @@ int nfs_atomic_open(struct inode *, struct dentry *, struct file *,
 extern struct file_system_type nfs4_fs_type;
 
 /* nfs4namespace.c */
-struct rpc_clnt *nfs4_create_sec_client(struct rpc_clnt *, struct inode *, struct qstr *);
+struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *, struct qstr *);
 struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *,
 			       struct nfs_fh *, struct nfs_fattr *);
 int nfs4_replace_transport(struct nfs_server *server,
fs/nfs/nfs4namespace.c +58 -45

150 lines not on this page · raw message

fs/nfs/nfs4proc.c +1 -1
index 68dd81e..fe14063 100644
@@ -3247,7 +3247,7 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
 			err = -EPERM;
 			if (client != *clnt)
 				goto out;
-			client = nfs4_create_sec_client(client, dir, name);
+			client = nfs4_negotiate_security(client, dir, name);
 			if (IS_ERR(client))
 				return PTR_ERR(client);
 
net/sunrpc/auth.c +1 -0
index 5285ead..1d97e19 100644
@@ -592,6 +592,7 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags)
 	put_group_info(acred.group_info);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(rpcauth_lookupcred);
 
 void
 rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred,
Signature · 1 line
1.8.3.1