2014-10-06 14:37:19

by Carl Hetherington

[permalink] [raw]
Subject: [PATCHv2 2/2] intermittent erroneous uid/gid bug with NFS4/Kerberos

nfs: Call request_valid_key_with_auxdata() from
nfs_idmap_request_key() so that the keys code asks userspace for an updated
key if one has expired. Without this, nfs_idmap_request_key() can return an
expired key which causes incorrect uid/gid mappings.

Signed-off-by: Carl Hetherington <[email protected]>
---
fs/nfs/idmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index 567983d..744e40f 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -278,8 +278,8 @@ static struct key *nfs_idmap_request_key(const char *name, size_t namelen,
rkey = request_key(&key_type_id_resolver, desc, "");
if (IS_ERR(rkey)) {
mutex_lock(&idmap->idmap_mutex);
- rkey = request_key_with_auxdata(&key_type_id_resolver_legacy,
- desc, "", 0, idmap);
+ rkey = request_valid_key_with_auxdata(&key_type_id_resolver_legacy,
+ desc, "", 0, idmap);
mutex_unlock(&idmap->idmap_mutex);
}

--
1.9.1