Re: [PATCH] cgroupfs: use init_cred when populating new cgroupfs mount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 25, 2011 at 2:35 PM, Eric Paris <eparis@xxxxxxxxxx> wrote:
>
> Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>

Acked-by: Paul Menage <menage@xxxxxxxxxx>

Thanks,
Paul

> ---
>
>  kernel/cgroup.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index 909a355..38b32dd 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -27,9 +27,11 @@
>  */
>
>  #include <linux/cgroup.h>
> +#include <linux/cred.h>
>  #include <linux/ctype.h>
>  #include <linux/errno.h>
>  #include <linux/fs.h>
> +#include <linux/init_task.h>
>  #include <linux/kernel.h>
>  #include <linux/list.h>
>  #include <linux/mm.h>
> @@ -1513,6 +1515,7 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,
>                struct cgroup *root_cgrp = &root->top_cgroup;
>                struct inode *inode;
>                struct cgroupfs_root *existing_root;
> +               const struct cred *cred;
>                int i;
>
>                BUG_ON(sb->s_root != NULL);
> @@ -1592,7 +1595,9 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,
>                BUG_ON(!list_empty(&root_cgrp->children));
>                BUG_ON(root->number_of_cgroups != 1);
>
> +               cred = override_creds(&init_cred);
>                cgroup_populate_dir(root_cgrp);
> +               revert_creds(cred);
>                mutex_unlock(&cgroup_mutex);
>                mutex_unlock(&inode->i_mutex);
>        } else {
>
>
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers



[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux