]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
nfs: fix false positives in nfs40_walk_client_list()
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 28 Nov 2016 14:02:52 +0000 (09:02 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 1 Dec 2016 22:43:31 +0000 (17:43 -0500)
commitced85a7568b57a671fe186562dfc601a5baab54d
treebf8045efb9b8580aed2095d9c838e21702a57e33
parent2c2ee6d20b10594892c1d31c7b959f4780adde63
nfs: fix false positives in nfs40_walk_client_list()

It's possible that two different servers can return the same (clientid,
verifier) pair purely by coincidence.  Both are 64-bit values, but
depending on the server implementation, they can be highly predictable
and collisions may be quite likely, especially when there are lots of
servers.

So, check for this case.  If the clientid and verifier both match, then
we actually know they *can't* be the same server, since a new
SETCLIENTID to an already-known server should have changed the verifier.

This helps fix a bug that could cause the client to mount a filesystem
from the wrong server.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Tested-by: Yongcheng Yang <yoyang@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4client.c