Commit 53e730f6 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd: lockd: don't try to match callback requests against export table

On lockd callbacks, we're a client, and the source address is that of a
server, so we shouldn't be trying to match the source address of the callback
request against our export table.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 30c22e80
......@@ -403,6 +403,18 @@ static int param_set_##name(const char *val, struct kernel_param *kp) \
return 0; \
}
static inline int is_callback(u32 proc)
{
return proc == NLMPROC_GRANTED
|| proc == NLMPROC_GRANTED_MSG
|| proc == NLMPROC_TEST_RES
|| proc == NLMPROC_LOCK_RES
|| proc == NLMPROC_CANCEL_RES
|| proc == NLMPROC_UNLOCK_RES
|| proc == NLMPROC_NSM_NOTIFY;
}
static int lockd_authenticate(struct svc_rqst *rqstp)
{
rqstp->rq_client = NULL;
......@@ -411,6 +423,12 @@ static int lockd_authenticate(struct svc_rqst *rqstp)
case RPC_AUTH_UNIX:
if (rqstp->rq_proc == 0)
return SVC_OK;
if (is_callback(rqstp->rq_proc)) {
/* Leave it to individual procedures to
* call nlmsvc_lookup_host(rqstp)
*/
return SVC_OK;
}
return svc_set_client(rqstp);
}
return SVC_DENIED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment