]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: cgroup_get_from_id() must check the looked-up kn is a directory
authorMing Lei <ming.lei@redhat.com>
Fri, 23 Sep 2022 11:51:19 +0000 (19:51 +0800)
committerTejun Heo <tj@kernel.org>
Fri, 23 Sep 2022 17:18:45 +0000 (07:18 -1000)
commitdf02452f3df069a59bc9e69c84435bf115cb6e37
tree4bbb542c16070918d40eb5746603739a45dce1d8
parenta81e18e963ce13ecfa4f0f11b185bc8372f203f8
cgroup: cgroup_get_from_id() must check the looked-up kn is a directory

cgroup has to be one kernfs dir, otherwise kernel panic is caused,
especially cgroup id is provide from userspace.

Reported-by: Marco Patalano <mpatalan@redhat.com>
Fixes: 6b658c4863c1 ("scsi: cgroup: Add cgroup_get_from_id()")
Cc: Muneendra <muneendra.kumar@broadcom.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Acked-by: Mukesh Ojha <quic_mojha@quicinc.com>
Cc: stable@vger.kernel.org # v5.14+
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c