Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935006Ab3DHGeK (ORCPT ); Mon, 8 Apr 2013 02:34:10 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:3752 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934980Ab3DHGeH (ORCPT ); Mon, 8 Apr 2013 02:34:07 -0400 Message-ID: <516264BF.2020009@huawei.com> Date: Mon, 8 Apr 2013 14:33:35 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Andrew Morton CC: Tejun Heo , Glauber Costa , KAMEZAWA Hiroyuki , Johannes Weiner , LKML , Cgroups , Subject: [PATCH 03/12] Revert "memcg: avoid dangling reference count in creation failure." References: <5162648B.9070802@huawei.com> In-Reply-To: <5162648B.9070802@huawei.com> Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.135.68.215] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1048 Lines: 34 From: Michal Hocko This reverts commit e4715f01be697a3730c78f8ffffb595591d6a88c 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: Li Zefan Signed-off-by: Michal Hocko --- mm/memcontrol.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2364f4e..44cec72 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6250,8 +6250,6 @@ mem_cgroup_css_online(struct cgroup *cont) * call __mem_cgroup_free, so return directly */ mem_cgroup_put(memcg); - if (parent->use_hierarchy) - mem_cgroup_put(parent); } return error; } -- 1.8.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/