aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2024-08-26 10:32:34 -0400
committerChuck Lever <chuck.lever@oracle.com>2024-08-26 19:04:00 -0400
commit7e8ae8486e4471513e2111aba6ac29f2357bed2a (patch)
treead3822cd62bc216375fac05bd1cfb3a45ab837bc /fs/nfsd/nfs4xdr.c
parentnfsd: fix potential UAF in nfsd4_cb_getattr_release (diff)
downloadwireguard-linux-7e8ae8486e4471513e2111aba6ac29f2357bed2a.tar.xz
wireguard-linux-7e8ae8486e4471513e2111aba6ac29f2357bed2a.zip
fs/nfsd: fix update of inode attrs in CB_GETATTR
Currently, we copy the mtime and ctime to the in-core inode and then mark the inode dirty. This is fine for certain types of filesystems, but not all. Some require a real setattr to properly change these values (e.g. ceph or reexported NFS). Fix this code to call notify_change() instead, which is the proper way to effect a setattr. There is one problem though: In this case, the client is holding a write delegation and has sent us attributes to update our cache. We don't want to break the delegation for this since that would defeat the purpose. Add a new ATTR_DELEG flag that makes notify_change bypass the try_break_deleg call. Fixes: c5967721e106 ("NFSD: handle GETATTR conflict with write delegation") Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 43ccf6119cf1..97f583777972 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3565,7 +3565,7 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
}
args.size = 0;
if (attrmask[0] & (FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE)) {
- status = nfsd4_deleg_getattr_conflict(rqstp, d_inode(dentry),
+ status = nfsd4_deleg_getattr_conflict(rqstp, dentry,
&file_modified, &size);
if (status)
goto out;