aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs/acl.c
Commit message (Collapse)AuthorAgeFilesLines
* f2fs: add additional sanity check in f2fs_acl_from_disk()Chengguang Xu2018-12-011-0/+3
| | | | | | | | | | Add additinal sanity check for irregular case(e.g. corruption). If size of extended attribution is smaller than size of acl header, then return -EINVAL. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: preserve i_mode if __f2fs_set_acl() failsErnesto A. Fernández2017-10-021-2/+3
| | | | | | | | | | | | | | | | | When changing a file's acl mask, __f2fs_set_acl() will first set the group bits of i_mode to the value of the mask, and only then set the actual extended attribute representing the new acl. If the second part fails (due to lack of space, for example) and the file had no acl attribute to begin with, the system will from now on assume that the mask permission bits are actual group permission bits, potentially granting access to the wrong users. Prevent this by only changing the inode mode after the acl has been set. Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: Don't clear SGID when inheriting ACLsJaegeuk Kim2017-07-211-1/+1
| | | | | | | | | | This patch copies commit b7f8a09f80: "btrfs: Don't clear SGID when inheriting ACLs" written by Jan. Fixes: 073931017b49d9458aa351605b43a7e34598caef CC: stable@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: remove the unnecessary cast for PTR_ERRZhang Shengju2017-07-211-1/+1
| | | | | | | It's not necessary to specify 'int' casting for PTR_ERR. Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: s/fi/inode/gAlbert I2017-04-161-1/+1
| | | | | | | * Causing build error when f2fs is enabled Change-Id: Icde63105fc7291f148e76427adf1104108cd03fd Signed-off-by: Albert I <krascgq@outlook.co.id>
* BACKPORT: posix_acl: Clear SGID bit when setting file permissionsJan Kara2017-04-161-5/+3
| | | | | | | | | | | | | | | | | | | | | | | (cherry pick from commit 073931017b49d9458aa351605b43a7e34598caef) When file permissions are modified via chmod(2) and the user is not in the owning group or capable of CAP_FSETID, the setgid bit is cleared in inode_change_ok(). Setting a POSIX ACL via setxattr(2) sets the file permissions as well as the new ACL, but doesn't clear the setgid bit in a similar way; this allows to bypass the check in chmod(2). Fix that. NB: conflicts resolution included extending the change to all visible users of the near deprecated function posix_acl_equiv_mode replaced with posix_acl_update_mode. We did not resolve the ACL leak in this CL, require additional upstream fixes. References: CVE-2016-7097 Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Bug: 32458736 Change-Id: I19591ad452cc825ac282b3cfd2daaa72aa9a1ac1
* f2fs: keep dirty inodes selectively for checkpointJaegeuk Kim2017-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This is to avoid no free segment bug during checkpoint caused by a number of dirty inodes. The case was reported by Chao like this. 1. mount with lazytime option 2. fill 4k file until disk is full 3. sync filesystem 4. read all files in the image 5. umount In this case, we actually don't need to flush dirty inode to inode page during checkpoint. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/acl.c fs/f2fs/inode.c fs/f2fs/namei.c
* f2fs: support configuring fault injection per superblockChao Yu2017-04-131-5/+7
| | | | | | | | | | | | | | | | | | | | Previously, we only support global fault injection configuration, so that when we configure type/rate of fault injection through sysfs, mount option, it will influence all f2fs partition which is being used. It is not make sence, since it will be not convenient if developer want to test separated partitions with different fault injection rate/type simultaneously, also it's not possible to enable fault injection in one partition and disable fault injection in other one. >From now on, we move global configuration of fault injection in module into per-superblock, hence injection testing can be more flexible. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/super.c
* f2fs: adjust other changesJaegeuk Kim2017-04-131-2/+2
| | | | | | | | | | This patch changes: - d_inode - file_dentry - inode_nohighmem - ... Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: avoid mark_inode_dirtyJaegeuk Kim2017-04-131-2/+2
| | | | | | Let's check inode's dirtiness before calling mark_inode_dirty. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: call mark_inode_dirty_sync for i_field changesJaegeuk Kim2017-04-131-0/+4
| | | | | | | | | | | | | | | | | | | | | This patch calls mark_inode_dirty_sync() for the following on-disk inode changes. -> largest -> ctime/mtime/atime -> i_current_depth -> i_xattr_nid -> i_pino -> i_advise -> i_flags -> i_mode Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/acl.c fs/f2fs/inode.c fs/f2fs/namei.c
* f2fs: use inode pointer for {set, clear}_inode_flagJaegeuk Kim2017-04-131-4/+3
| | | | | | | | | | | | This patch refactors to use inode pointer for set_inode_flag and clear_inode_flag. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: fs/f2fs/acl.c fs/f2fs/file.c fs/f2fs/namei.c
* f2fs: introduce f2fs_kmalloc to wrap kmallocJaegeuk Kim2017-04-131-2/+2
| | | | | | This patch adds f2fs_kmalloc. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* f2fs: catch up to v4.4-rc1Jaegeuk Kim2017-04-131-29/+36
| | | | | | | | | | | | | | | | The last patch is: commit beaa57dd986d4f398728c060692fc2452895cfd8 Author: Chao Yu <chao2.yu@samsung.com> Date: Thu Oct 22 18:24:12 2015 +0800 f2fs: fix to skip shrinking extent nodes In f2fs_shrink_extent_tree we should stop shrink flow if we have already shrunk enough nodes in extent cache. Change-Id: I704e8e1a29a871604c63689d67c9005ab3ac6e5c Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
* first commitMeizu OpenSource2016-08-151-0/+412