mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
f2fs: fix out-of-repair __setattr_copy()
commit2562515f0a
upstream. __setattr_copy() was copied from setattr_copy() in fs/attr.c, there is two missing patches doesn't cover this inner function, fix it. Commit7fa294c899
("userns: Allow chown and setgid preservation") Commit23adbe12ef
("fs,userns: Change inode_capable to capable_wrt_inode_uidgid") Fixes:fbfa2cc58d
("f2fs: add file operations") Cc: stable@vger.kernel.org Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5b5d760280
commit
7e17044631
1 changed files with 2 additions and 1 deletions
|
@ -765,7 +765,8 @@ static void __setattr_copy(struct inode *inode, const struct iattr *attr)
|
|||
if (ia_valid & ATTR_MODE) {
|
||||
umode_t mode = attr->ia_mode;
|
||||
|
||||
if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
|
||||
if (!in_group_p(inode->i_gid) &&
|
||||
!capable_wrt_inode_uidgid(inode, CAP_FSETID))
|
||||
mode &= ~S_ISGID;
|
||||
set_acl_inode(inode, mode);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue