]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lockd: fix NLMv3 GRANTED_MSG handling
authorOlga Kornievskaia <okorniev@redhat.com>
Thu, 25 Jun 2026 21:18:52 +0000 (17:18 -0400)
committerChuck Lever <cel@kernel.org>
Fri, 17 Jul 2026 13:31:50 +0000 (09:31 -0400)
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: 6c534ad999b6 ("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>
fs/lockd/svcproc.c

index 4836887f11ef003a9c5ac0eba38bf552802d4dcf..386a881b520fd9e158717fee8e2f9ee01e41e4a2 100644 (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;