diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-08-29 06:20:44 +1200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-08-29 06:20:44 +1200 |
commit | a18093afa393d03599cbe42da2eb00d84a1c9a34 (patch) | |
tree | facc88f8f4c32faf2557ad9e872e6d8bf2ff12bc /fs/attr.c | |
parent | 2840526875c7e3bcfb3364420b70efa203bad428 (diff) | |
parent | 7e8ae8486e4471513e2111aba6ac29f2357bed2a (diff) |
Merge tag 'nfsd-6.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fixes from Chuck Lever:
- Fix a number of crashers
- Update email address for an NFSD reviewer
* tag 'nfsd-6.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
fs/nfsd: fix update of inode attrs in CB_GETATTR
nfsd: fix potential UAF in nfsd4_cb_getattr_release
nfsd: hold reference to delegation when updating it for cb_getattr
MAINTAINERS: Update Olga Kornievskaia's email address
nfsd: prevent panic for nfsv4.0 closed files in nfs4_show_open
nfsd: ensure that nfsd4_fattr_args.context is zeroed out
Diffstat (limited to 'fs/attr.c')
-rw-r--r-- | fs/attr.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/attr.c b/fs/attr.c index 825007d5cda4..c04d19b58f12 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -487,9 +487,17 @@ int notify_change(struct mnt_idmap *idmap, struct dentry *dentry, error = security_inode_setattr(idmap, dentry, attr); if (error) return error; - error = try_break_deleg(inode, delegated_inode); - if (error) - return error; + + /* + * If ATTR_DELEG is set, then these attributes are being set on + * behalf of the holder of a write delegation. We want to avoid + * breaking the delegation in this case. + */ + if (!(ia_valid & ATTR_DELEG)) { + error = try_break_deleg(inode, delegated_inode); + if (error) + return error; + } if (inode->i_op->setattr) error = inode->i_op->setattr(idmap, dentry, attr); |