Re: [PATCH v2] cgroup: avoid accessing modular cgroup subsysstructure without locking

From: Tejun Heo
Date: Tue Mar 05 2013 - 12:34:12 EST


On Tue, Mar 05, 2013 at 10:57:03AM +0800, Li Zefan wrote:
> subsys[i] is set to NULL in cgroup_unload_subsys() at modular unload,
> and that's protected by cgroup_mutex, and then the memory *subsys[i]
> resides will be freed.
>
> So this is unsafe without any locking:
>
> if (!ss || ss->module)
> ...
>
> v2:
> - add a comment for enum cgroup_subsys_id
> - simplify the comment in cgroup_exit()
>
> Signed-off-by: Li Zefan <lizefan@xxxxxxxxxx>

Applied to cgroup/for-3.10.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/