linux-stable/fs/nfsd
Dai Ngo 944ec8c775 NFSD: detect mismatch of file handle and delegation stateid in OPEN op
commit 9c65001c57 upstream.

When the client sends an OPEN with claim type CLAIM_DELEG_CUR_FH or
CLAIM_DELEGATION_CUR, the delegation stateid and the file handle
must belong to the same file, otherwise return NFS4ERR_INVAL.

Note that RFC8881, section 8.2.4, mandates the server to return
NFS4ERR_BAD_STATEID if the selected table entry does not match the
current filehandle. However returning NFS4ERR_BAD_STATEID in the
OPEN causes the client to retry the operation and therefor get the
client into a loop. To avoid this situation we return NFS4ERR_INVAL
instead.

Reported-by: Petro Pavlov <petro.pavlov@vastdata.com>
Fixes: c44c5eeb2c ("[PATCH] nfsd4: add open state code for CLAIM_DELEGATE_CUR")
Cc: stable@vger.kernel.org
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-20 18:30:14 +02:00
..
acl.h
auth.c
auth.h
blocklayout.c
blocklayoutxdr.c
blocklayoutxdr.h
cache.h
current_stateid.h
export.c
export.h
filecache.c
filecache.h
flexfilelayout.c
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
Kconfig
localio.c
lockd.c
Makefile
netlink.c
netlink.h
netns.h
nfs2acl.c
nfs3acl.c
nfs3proc.c
nfs3xdr.c
nfs4acl.c
nfs4callback.c
nfs4idmap.c
nfs4layouts.c
nfs4proc.c nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request 2025-06-27 11:11:15 +01:00
nfs4recover.c
nfs4state.c NFSD: detect mismatch of file handle and delegation stateid in OPEN op 2025-08-20 18:30:14 +02:00
nfs4xdr.c NFSD: Implement FATTR4_CLONE_BLKSIZE attribute 2025-06-27 11:11:15 +01:00
nfscache.c
nfsctl.c nfsd: use threads array as-is in netlink interface 2025-06-27 11:11:40 +01:00
nfsd.h
nfsfh.c
nfsfh.h
nfsproc.c
nfssvc.c nfsd: Initialize ssc before laundromat_work to prevent NULL dereference 2025-06-27 11:11:15 +01:00
nfsxdr.c
pnfs.h
state.h
stats.c
stats.h
trace.c
trace.h
vfs.c
vfs.h
xdr3.h
xdr4.h
xdr4cb.h
xdr.h