Skip to content

Commit 916d636

Browse files
committed
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
2 parents 8bda955 + d03ef4d commit 916d636

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/ioctl.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,14 @@ static int fileattr_set_prepare(struct inode *inode,
614614
if ((old_ma->fsx_xflags ^ fa->fsx_xflags) &
615615
FS_XFLAG_PROJINHERIT)
616616
return -EINVAL;
617+
} else {
618+
/*
619+
* Caller is allowed to change the project ID. If it is being
620+
* changed, make sure that the new value is valid.
621+
*/
622+
if (old_ma->fsx_projid != fa->fsx_projid &&
623+
!projid_valid(make_kprojid(&init_user_ns, fa->fsx_projid)))
624+
return -EINVAL;
617625
}
618626

619627
/* Check extent size hints. */

0 commit comments

Comments
 (0)