From: Chao Yu <yuchao0@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [PATCH] f2fs: avoid selinux denial on CAP_SYS_RESOURCE
Date: Fri, 9 Mar 2018 14:22:09 +0800 [thread overview]
Message-ID: <5ec9338e-1522-2b6a-99c2-ffe70b7a06a9@huawei.com> (raw)
In-Reply-To: <20180309044900.39677-1-jaegeuk@kernel.org>
On 2018/3/9 12:49, Jaegeuk Kim wrote:
> This fixes CAP_SYS_RESOURCE denial of selinux when using resgid.
A little confusion, if capable(CAP_SYS_RESOURCE) is false, we still have chance
to return true for below resuid & resgid cases, right?
Thanks,
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> fs/f2fs/f2fs.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index f6dc70666ebb..3d12277fbe9e 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -1607,13 +1607,13 @@ static inline bool __allow_reserved_blocks(struct f2fs_sb_info *sbi,
> return false;
> if (IS_NOQUOTA(inode))
> return true;
> - if (capable(CAP_SYS_RESOURCE))
> - return true;
> if (uid_eq(sbi->s_resuid, current_fsuid()))
> return true;
> if (!gid_eq(sbi->s_resgid, GLOBAL_ROOT_GID) &&
> in_group_p(sbi->s_resgid))
> return true;
> + if (capable(CAP_SYS_RESOURCE))
> + return true;
> return false;
> }
>
>
next prev parent reply other threads:[~2018-03-09 6:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 4:49 Jaegeuk Kim
2018-03-09 6:22 ` Chao Yu [this message]
2018-03-09 21:57 ` Jaegeuk Kim
2018-03-14 13:07 ` [f2fs-dev] " Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5ec9338e-1522-2b6a-99c2-ffe70b7a06a9@huawei.com \
--to=yuchao0@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®