The patch titled Subject: memcg: avoid accessing memcg after releasing reference has been added to the -mm tree. Its filename is memcg-avoid-accessing-memcg-after-releasing-reference.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Li Zefan <lizefan@xxxxxxxxxx> Subject: memcg: avoid accessing memcg after releasing reference This might cause a use-after-free bug. Signed-off-by: Li Zefan <lizefan@xxxxxxxxxx> Cc: Glauber Costa <glommer@xxxxxxxxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxx> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/memcontrol.c~memcg-avoid-accessing-memcg-after-releasing-reference mm/memcontrol.c --- a/mm/memcontrol.c~memcg-avoid-accessing-memcg-after-releasing-reference +++ a/mm/memcontrol.c @@ -3215,12 +3215,12 @@ void memcg_release_cache(struct kmem_cac root = s->memcg_params->root_cache; root->memcg_params->memcg_caches[id] = NULL; - mem_cgroup_put(memcg); mutex_lock(&memcg->slab_caches_mutex); list_del(&s->memcg_params->list); mutex_unlock(&memcg->slab_caches_mutex); + mem_cgroup_put(memcg); out: kfree(s->memcg_params); } _ Patches currently in -mm which might be from lizefan@xxxxxxxxxx are linux-next.patch memcg-keep-prevs-css-alive-for-the-whole-mem_cgroup_iter.patch memcg-rework-mem_cgroup_iter-to-use-cgroup-iterators.patch memcg-relax-memcg-iter-caching.patch memcg-simplify-mem_cgroup_iter.patch memcg-further-simplify-mem_cgroup_iter.patch cgroup-remove-css_get_next.patch kernel-cpusetc-use-register_hotmemory_notifier.patch memcg-avoid-accessing-memcg-after-releasing-reference.patch exec-do-not-abuse-cred_guard_mutex-in-threadgroup_lock.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html