diff --git a/[refs] b/[refs] index 367d95470f9d..037102ffdbd9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ea7e743e49b94749fc739baaf160809ed279aeda +refs/heads/master: 33d283bef23132c48195eafc21449f8ba88fce6b diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index 1a06be61dcd0..fe00b3b983a8 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -2039,10 +2039,13 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry) struct cgroup *cgrp; struct cgroup_iter it; struct task_struct *tsk; + /* - * Validate dentry by checking the superblock operations + * Validate dentry by checking the superblock operations, + * and make sure it's a directory. */ - if (dentry->d_sb->s_op != &cgroup_ops) + if (dentry->d_sb->s_op != &cgroup_ops || + !S_ISDIR(dentry->d_inode->i_mode)) goto err; ret = 0;