3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Michal Hocko <mho...@suse.cz>

commit fa460c2d37870e0a6f94c70e8b76d05ca11b6db0 upstream.

This reverts commit e4715f01be697a.

mem_cgroup_put is hierarchy aware so mem_cgroup_put(memcg) already drops
an additional reference from all parents so the additional
mem_cgrroup_put(parent) potentially causes use-after-free.

Signed-off-by: Michal Hocko <mho...@suse.cz>
Signed-off-by: Li Zefan <lize...@huawei.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hir...@jp.fujitsu.com>
Cc: Hugh Dickins <hu...@google.com>
Cc: Tejun Heo <t...@kernel.org>
Cc: Glauber Costa <glom...@openvz.org>
Cc: Johannes Weiner <han...@cmpxchg.org>
Signed-off-by: Andrew Morton <a...@linux-foundation.org>
Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 mm/memcontrol.c |    2 --
 1 file changed, 2 deletions(-)

--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6303,8 +6303,6 @@ mem_cgroup_css_online(struct cgroup *con
                 * call __mem_cgroup_free, so return directly
                 */
                mem_cgroup_put(memcg);
-               if (parent->use_hierarchy)
-                       mem_cgroup_put(parent);
        }
        return error;
 }


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

Reply via email to