Re: [PATCH] cgroup: Fix crash with CLONE_INTO_CGROUP and v1 cgroups

From: Christian Brauner
Date: Sun Oct 09 2022 - 13:37:49 EST


On Sun, Oct 09, 2022 at 03:10:36PM +0200, Christian A. Ehrhardt wrote:
>
> Since commit f3a2aebdd6, Version 1 cgroups no longer cause an
> error when used with CLONE_INTO_CGROUP. However, the permission
> checks performed during clone assume a Version 2 cgroup.
>
> Restore the error check for V1 cgroups in the clone() path.
>
> Reported-by: syzbot+534ee3d24c37c411f37f@xxxxxxxxxxxxxxxxxxxxxxxxx
> Link: https://lore.kernel.org/lkml/000000000000385cbf05ea3f1862@xxxxxxxxxx/
> Fixes: f3a2aebdd6 ("cgroup: enable cgroup_get_from_file() on cgroup1")
> Signed-off-by: Christian A. Ehrhardt <lk@xxxxxxx>
> ---

Thanks for fixing this,
Reviewed-by: Christian Brauner (Microsoft) <brauner@xxxxxxxxxx>

Fwiw, @Tejun, after
f3a2aebdd6 ("cgroup: enable cgroup_get_from_file() on cgroup1")
that non-me-Christian fixes with this patch cgroup_get_from_file() looks
a bit odd. It could use sm like: