From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Chris Wright <chrisw@sous-sol.org>
Cc: Christoph Hellwig <hch@infradead.org>,
"Daniel P. Berrange" <berrange@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blkdev: cgroup whitelist permission fix
Date: Mon, 17 May 2010 23:45:25 -0500 [thread overview]
Message-ID: <20100518044525.GA5625@us.ibm.com> (raw)
In-Reply-To: <20100514074003.GK28034@sequoia.sous-sol.org>
Quoting Chris Wright (chrisw@sous-sol.org):
> The cgroup device whitelist code gets confused when trying to grant
> permission to a disk partition that is not currently open. Part of
> blkdev_open() includes __blkdev_get() on the whole disk. This simply
> avoids the cgroup check for the whole disk case when opening a
> partition.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=589662
>
> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Thanks, Chris, sorry for the delay.
Acked-by: Serge E. Hallyn <serue@us.ibm.com>
Tested-by: Serge E. Hallyn <serue@us.ibm.com>
> ---
> fs/block_dev.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 6dcee88..d4d19ac 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1192,10 +1192,12 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
> /*
> * hooks: /n/, see "layering violations".
> */
> - ret = devcgroup_inode_permission(bdev->bd_inode, perm);
> - if (ret != 0) {
> - bdput(bdev);
> - return ret;
> + if (!for_part) {
> + ret = devcgroup_inode_permission(bdev->bd_inode, perm);
> + if (ret != 0) {
> + bdput(bdev);
> + return ret;
> + }
> }
>
> lock_kernel();
next prev parent reply other threads:[~2010-05-18 4:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-14 7:40 Chris Wright
2010-05-18 4:45 ` Serge E. Hallyn [this message]
2010-06-04 20:15 Chris Wright
2010-07-15 15:54 ` Chris Wright
2010-07-23 0:03 Chris Wright
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=20100518044525.GA5625@us.ibm.com \
--to=serue@us.ibm.com \
--cc=berrange@redhat.com \
--cc=chrisw@sous-sol.org \
--cc=hch@infradead.org \
--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
Powered by JetHome