lockd: fix NLMv3 GRANTED_MSG handling

GRANTED_MSG is a server-to-client callback, so it runs on the client,
where nfsd never registers nlmsvc_ops. The nlm3svc_lookup_host()
helper is for the server-side request handlers
(TEST/LOCK/CANCEL/UNLOCK), which reach nlmsvc_ops->fopen and must
reject requests when nfsd isn't running. GRANTED_MSG only calls
nlmclnt_grant(). Instead, of calling nlm3svc_lookup_host(), which
results in a client failing a GRANTED_MSG call, call
nlmsvc_lookup_host().

Fixes: 6c534ad999 ("lockd: Use xdrgen XDR functions for the NLMv3 GRANTED_MSG procedure")
Cc: stable@vger.kernel.org
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Reviewed-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260625211852.31972-1-okorniev@redhat.com
Signed-off-by: Chuck Lever <cel@kernel.org>
This commit is contained in:
Olga Kornievskaia 2026-06-25 17:18:52 -04:00 committed by Chuck Lever
parent 92ea163c77
commit 5c4851e4cd

View File

@ -901,7 +901,8 @@ static __be32 nlmsvc_proc_granted_msg(struct svc_rqst *rqstp)
if (argp->xdrgen.cookie.len > NLM_MAXCOOKIELEN)
return rpc_garbage_args;
host = nlm3svc_lookup_host(rqstp, argp->xdrgen.alock.caller_name, false);
host = nlmsvc_lookup_host(rqstp, argp->xdrgen.alock.caller_name.data,
argp->xdrgen.alock.caller_name.len);
if (!host)
return rpc_system_err;