aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@primarydata.com>2017-07-16 18:57:27 -0400
committerJ. Bruce Fields <bfields@redhat.com>2017-07-17 13:15:06 -0400
commiteff793687792d3eed594d147aceef2000fb9ca3d (patch)
treee750a4e8ac871be61017c7e297924e2618893218
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff)
nfsd: Fix a memory scribble in the callback channel
The offset of the entry in struct rpc_version has to match the version number. Reported-by: Dave Jones <davej@codemonkey.org.uk> Fixes: 1c5876ddbdb4 ("sunrpc: move p_count out of struct rpc_procinfo") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Reported-by: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4callback.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index b45083c0f9ae..49b0a9e7ff18 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -720,8 +720,8 @@ static const struct rpc_version nfs_cb_version4 = {
720 .counts = nfs4_cb_counts, 720 .counts = nfs4_cb_counts,
721}; 721};
722 722
723static const struct rpc_version *nfs_cb_version[] = { 723static const struct rpc_version *nfs_cb_version[2] = {
724 &nfs_cb_version4, 724 [1] = &nfs_cb_version4,
725}; 725};
726 726
727static const struct rpc_program cb_program; 727static const struct rpc_program cb_program;
@@ -795,7 +795,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
795 .saddress = (struct sockaddr *) &conn->cb_saddr, 795 .saddress = (struct sockaddr *) &conn->cb_saddr,
796 .timeout = &timeparms, 796 .timeout = &timeparms,
797 .program = &cb_program, 797 .program = &cb_program,
798 .version = 0, 798 .version = 1,
799 .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET), 799 .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
800 }; 800 };
801 struct rpc_clnt *client; 801 struct rpc_clnt *client;