linux/fs/ext4
Wang Shilong dc7ac6c4ca ext4: fix setattr project check in fssetxattr ioctl
Currently, project quota could be changed by fssetxattr
ioctl, and existed permission check inode_owner_or_capable()
is obviously not enough, just think that common users could
change project id of file, that could make users to
break project quota easily.

This patch try to follow same regular of xfs project
quota:

"Project Quota ID state is only allowed to change from
within the init namespace. Enforce that restriction only
if we are trying to change the quota ID state.
Everything else is allowed in user namespaces."

Besides that, check and set project id'state should
be an atomic operation, protect whole operation with
inode lock, ext4_ioctl_setproject() is only used for
ioctl EXT4_IOC_FSSETXATTR, we have held mnt_want_write_file()
before ext4_ioctl_setflags(), and ext4_ioctl_setproject()
is called after ext4_ioctl_setflags(), we could share
codes, so remove it inside ext4_ioctl_setproject().

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Cc: stable@kernel.org
2018-10-03 10:33:32 -04:00
..
acl.c
acl.h
balloc.c ext4: use ext4_warning() for sb_getblk failure 2018-08-01 12:02:31 -04:00
bitmap.c
block_validity.c
dir.c ext4: avoid divide by zero fault when deleting corrupted inline directories 2018-08-27 09:22:45 -04:00
ext4.h ext4: convert fault handler to use vm_fault_t type 2018-10-02 22:20:50 -04:00
ext4_extents.h ext4: adjust reserved cluster count when removing extents 2018-10-01 14:25:08 -04:00
ext4_jbd2.c
ext4_jbd2.h
extents.c ext4: adjust reserved cluster count when removing extents 2018-10-01 14:25:08 -04:00
extents_status.c ext4: fix reserved cluster accounting at page invalidation time 2018-10-01 14:33:24 -04:00
extents_status.h ext4: reduce reserved cluster count by number of allocated clusters 2018-10-01 14:24:08 -04:00
file.c dax: remove VM_MIXEDMAP for fsdax and device dax 2018-08-17 16:20:27 -07:00
fsmap.c
fsmap.h
fsync.c
hash.c
ialloc.c ext4: use ext4_warning() for sb_getblk failure 2018-08-01 12:02:31 -04:00
indirect.c
inline.c ext4: initialize retries variable in ext4_da_write_inline_data_begin() 2018-10-02 21:18:45 -04:00
inode.c ext4: convert fault handler to use vm_fault_t type 2018-10-02 22:20:50 -04:00
ioctl.c ext4: fix setattr project check in fssetxattr ioctl 2018-10-03 10:33:32 -04:00
Kconfig
Makefile
mballoc.c ext4: adjust reserved cluster count when removing extents 2018-10-01 14:25:08 -04:00
mballoc.h
migrate.c
mmp.c ext4: don't mark mmp buffer head dirty 2018-09-15 17:11:25 -04:00
move_extent.c ext4: fix argument checking in EXT4_IOC_MOVE_EXT 2018-10-02 01:34:44 -04:00
namei.c ext4: fix build error when DX_DEBUG is defined 2018-10-02 12:43:51 -04:00
page-io.c
readpage.c ext4: readpages() should submit IO as read-ahead 2018-08-17 16:20:29 -07:00
resize.c ext4: fix online resizing for bigalloc file systems with a 1k block size 2018-09-03 22:25:01 -04:00
super.c ext4: add new pending reservation mechanism 2018-10-01 14:17:41 -04:00
symlink.c
sysfs.c for-4.19/block-20180812 2018-08-14 10:23:25 -07:00
truncate.h ext4: handle layout changes to pinned DAX mappings 2018-07-29 17:00:22 -04:00
xattr.c ext4: check for NUL characters in extended attribute's name 2018-08-01 12:36:52 -04:00
xattr.h
xattr_security.c
xattr_trusted.c
xattr_user.c