Skip to content

Commit

Permalink
nfsd: Fix a memory scribble in the callback channel
Browse files Browse the repository at this point in the history
The offset of the entry in struct rpc_version has to match the version
number.

Reported-by: Dave Jones <[email protected]>
Fixes: 1c5876d ("sunrpc: move p_count out of struct rpc_procinfo")
Signed-off-by: Trond Myklebust <[email protected]>
Reported-by: Dave Jones <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
trondmypd authored and J. Bruce Fields committed Jul 17, 2017
1 parent 5771a8c commit eff7936
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,8 @@ static const struct rpc_version nfs_cb_version4 = {
.counts = nfs4_cb_counts,
};

static const struct rpc_version *nfs_cb_version[] = {
&nfs_cb_version4,
static const struct rpc_version *nfs_cb_version[2] = {
[1] = &nfs_cb_version4,
};

static const struct rpc_program cb_program;
Expand Down Expand Up @@ -795,7 +795,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
.saddress = (struct sockaddr *) &conn->cb_saddr,
.timeout = &timeparms,
.program = &cb_program,
.version = 0,
.version = 1,
.flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
};
struct rpc_clnt *client;
Expand Down

0 comments on commit eff7936

Please sign in to comment.