diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-08-31 11:06:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-08-31 11:06:32 -0700 |
commit | 916d636e0a2df48be48b573d8ec9070408d7681f (patch) | |
tree | 823e9704c2c7e5de6b377eb6d1d46f3e8bba48a0 | |
parent | 8bda95577627dc0633c48d581ea3605c27efe829 (diff) | |
parent | d03ef4daf33a33da8d7c397102fff8ae87d04a93 (diff) |
Merge tag 'vfs-5.15-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull project quota update from Darrick Wong:
"A single VFS patch that prevents userspace from setting project quota
ids on files that the VFS considers invalid"
* tag 'vfs-5.15-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
fs: forbid invalid project ID
-rw-r--r-- | fs/ioctl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ioctl.c b/fs/ioctl.c index eea8267ae1f2..504e69578112 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -614,6 +614,14 @@ static int fileattr_set_prepare(struct inode *inode, if ((old_ma->fsx_xflags ^ fa->fsx_xflags) & FS_XFLAG_PROJINHERIT) return -EINVAL; + } else { + /* + * Caller is allowed to change the project ID. If it is being + * changed, make sure that the new value is valid. + */ + if (old_ma->fsx_projid != fa->fsx_projid && + !projid_valid(make_kprojid(&init_user_ns, fa->fsx_projid))) + return -EINVAL; } /* Check extent size hints. */ |