From b1eb9f1aea88a0d7ec8116a70c33b7b31ad0a3eb Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Tue, 15 Sep 2026 20:42:40 -0400 Subject: [PATCH] NFSD: map fh_verify() status codes for NFS_ACLv3 replies The NFS_ACLv3 protocol shares its status code space with NFSv3, which has NFS3ERR_BADHANDLE but no NFSERR_NOFILEHANDLE. An NFS_ACLv3 GETACL or SETACL request that carries an empty file handle gets a reply with status 10020, a value the client cannot interpret. Commit 1459ad57673b ("nfsd: Move error code mapping to per-version proc code.") made fh_verify() return nfserr_nofilehandle for an empty handle regardless of protocol version. The NFSv3 procedures gained nfsd3_map_status() in exchange, but the NFS_ACLv3 procedures did not, so the unmapped status reaches the encoder. Add the same mapping to the NFS_ACLv3 procedures. Fixes: 1459ad57673b ("nfsd: Move error code mapping to per-version proc code.") Cc: stable@vger.kernel.org Reviewed-by: Jeff Layton Link: https://patch.msgid.link/20260916004240.141975-2-cel@kernel.org Signed-off-by: Chuck Lever --- fs/nfsd/nfs3acl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fs/nfsd/nfs3acl.c b/fs/nfsd/nfs3acl.c index 7183995182ab..5219ec634587 100644 --- a/fs/nfsd/nfs3acl.c +++ b/fs/nfsd/nfs3acl.c @@ -14,6 +14,19 @@ #include "xdr3.h" #include "vfs.h" +static __be32 nfsd3_map_status(__be32 status) +{ + switch (status) { + case nfserr_nofilehandle: + status = nfserr_badhandle; + break; + case nfserr_wrongsec: + status = nfserr_acces; + break; + } + return status; +} + /* * NULL call. */ @@ -72,6 +85,7 @@ static __be32 nfsd3_proc_getacl(struct svc_rqst *rqstp) /* resp->acl_{access,default} are released in nfs3svc_release_getacl. */ out: + resp->status = nfsd3_map_status(resp->status); return rpc_success; fail: @@ -125,6 +139,7 @@ static __be32 nfsd3_proc_setacl(struct svc_rqst *rqstp) resp->status = nfserrno(error); out: /* argp->acl_{access,default} are released in nfs3svc_release_setacl. */ + resp->status = nfsd3_map_status(resp->status); return rpc_success; }