Re: [PATCH 2/2] cgroup: avoid accessing modular cgroup subsys structure without locking

2013-03-04 Thread Tejun Heo
Hello, Li. On Fri, Mar 01, 2013 at 03:06:36PM +0800, Li Zefan wrote: > /* Define the enumeration of all builtin cgroup subsystems */ > #define SUBSYS(_x) _x ## _subsys_id, > -#define IS_SUBSYS_ENABLED(option) IS_ENABLED(option) > enum cgroup_subsys_id { > +#define IS_SUBSYS_ENABLED(option) IS_B

[PATCH 2/2] cgroup: avoid accessing modular cgroup subsys structure without locking

2013-02-28 Thread Li Zefan
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) ... Signed-off-by: Li Zefan --- include/linux/cgroup.h | 11 ++