lkml.org 
[lkml]   [2010]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] blkdev: cgroup whitelist permission fix
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();


\
 
 \ /
  Last update: 2010-05-18 06:47    [W:0.075 / U:5.564 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site