f2fs: avoid selinux denial on CAP_SYS_RESOURCE
This fixes CAP_SYS_RESOURCE denial of selinux when using resgid, since it seems selinux reports it at the first place, but mostly we don't need to check this condition first. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
076a6f32fe
commit
6c6611223a
1 changed files with 2 additions and 2 deletions
|
@ -1671,13 +1671,13 @@ static inline bool __allow_reserved_blocks(struct f2fs_sb_info *sbi,
|
||||||
return false;
|
return false;
|
||||||
if (IS_NOQUOTA(inode))
|
if (IS_NOQUOTA(inode))
|
||||||
return true;
|
return true;
|
||||||
if (capable(CAP_SYS_RESOURCE))
|
|
||||||
return true;
|
|
||||||
if (uid_eq(sbi->s_resuid, current_fsuid()))
|
if (uid_eq(sbi->s_resuid, current_fsuid()))
|
||||||
return true;
|
return true;
|
||||||
if (!gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) &&
|
if (!gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) &&
|
||||||
in_group_p(sbi->s_resgid))
|
in_group_p(sbi->s_resgid))
|
||||||
return true;
|
return true;
|
||||||
|
if (capable(CAP_SYS_RESOURCE))
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue