lockd: fix NLMv4 GRANTED_MSG handling

JIRA: https://issues.redhat.com/browse/RHEL-186673
Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/log/?h=nfsd-testing

commit 2944997996a6e1a96bd3583fb32c2bdde502a8d4
Author: Olga Kornievskaia <okorniev@redhat.com>
Date:   Thu Jun 25 17:18:52 2026 -0400

    lockd: fix NLMv4 GRANTED_MSG handling

    GRANTED_MSG is a server-to-client callback, so it runs on the client,
    where nfsd never registers nlmsvc_ops. The nlm4svc_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 nlm4svc_lookup_host(), which
    results in a client failing a GRANTED_MSG call, call
    nlmsvc_lookup_host().

    Fixes: 62721885e861 ("lockd: Use xdrgen XDR functions for the NLMv4 GRANTED_MSG procedure")
    Cc: stable@vger.kernel.org
    Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
    Reviewed-by: NeilBrown <neil@brown.name>
    Signed-off-by: Chuck Lever <cel@kernel.org>

Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
This commit is contained in:
Olga Kornievskaia
2026-07-07 14:27:32 -04:00
parent 0b8a0810bb
commit 05a03bdbfc
+2 -1
View File
@@ -863,7 +863,8 @@ static __be32 nlm4svc_proc_granted_msg(struct svc_rqst *rqstp)
struct nlm4_testargs_wrapper *argp = rqstp->rq_argp;
struct nlm_host *host;
host = nlm4svc_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;