Skip to content

Commit 1772094

Browse files
committed
Merge tag 'cgroup-for-6.0-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fixes from Tejun Heo: - Add Waiman Long as a cpuset maintainer - cgroup_get_from_id() could be fed a kernfs ID which doesn't point to a cgroup directory but a knob file and then crash. Error out if the lookup kernfs_node isn't a directory. * tag 'cgroup-for-6.0-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: cgroup_get_from_id() must check the looked-up kn is a directory cpuset: Add Waiman Long as a cpuset maintainer
2 parents aae8dda + df02452 commit 1772094

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5246,6 +5246,7 @@ F: block/blk-throttle.c
52465246
F: include/linux/blk-cgroup.h
52475247

52485248
CONTROL GROUP - CPUSET
5249+
M: Waiman Long <longman@redhat.com>
52495250
M: Zefan Li <lizefan.x@bytedance.com>
52505251
L: cgroups@vger.kernel.org
52515252
S: Maintained

kernel/cgroup/cgroup.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6049,14 +6049,17 @@ struct cgroup *cgroup_get_from_id(u64 id)
60496049
if (!kn)
60506050
goto out;
60516051

6052+
if (kernfs_type(kn) != KERNFS_DIR)
6053+
goto put;
6054+
60526055
rcu_read_lock();
60536056

60546057
cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv);
60556058
if (cgrp && !cgroup_tryget(cgrp))
60566059
cgrp = NULL;
60576060

60586061
rcu_read_unlock();
6059-
6062+
put:
60606063
kernfs_put(kn);
60616064
out:
60626065
return cgrp;

0 commit comments

Comments
 (0)