[PATCH] cgroupfs: use init_cred when populating new cgroupfs mount
Paul Menage
menage at google.com
Wed May 25 15:16:01 PDT 2011
On Wed, May 25, 2011 at 2:35 PM, Eric Paris <eparis at redhat.com> wrote:
>
> Signed-off-by: Eric Paris <eparis at redhat.com>
Acked-by: Paul Menage <menage at google.com>
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 {
>
>
More information about the Containers
mailing list