stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Michal Hocko <mhocko@suse.cz>,
	Li Zefan <lizefan@huawei.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Hugh Dickins <hughd@google.com>, Tejun Heo <tj@kernel.org>,
	Glauber Costa <glommer@openvz.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [ 15/15] Revert "memcg: avoid dangling reference count in creation failure"
Date: Thu, 11 Jul 2013 15:19:45 -0700	[thread overview]
Message-ID: <20130711221257.646563383@linuxfoundation.org> (raw)
In-Reply-To: <20130711221255.925669600@linuxfoundation.org>

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

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

From: Michal Hocko <mhocko@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 <mhocko@suse.cz>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Glauber Costa <glommer@openvz.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6186,8 +6186,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;
 }



  parent reply	other threads:[~2013-07-11 22:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 22:19 [ 00/15] 3.9.10-stable review Greg Kroah-Hartman
2013-07-11 22:19 ` [ 01/15] libceph: Fix NULL pointer dereference in auth client code Greg Kroah-Hartman
2013-07-11 22:19 ` [ 02/15] ceph: fix sleeping function called from invalid context Greg Kroah-Hartman
2013-07-11 22:19 ` [ 03/15] drivers/cdrom/cdrom.c: use kzalloc() for failing hardware Greg Kroah-Hartman
2013-07-11 22:19 ` [ 04/15] module: do percpu allocation after uniqueness check. No, really! Greg Kroah-Hartman
2013-07-11 22:19 ` [ 05/15] charger-manager: Ensure event is not used as format string Greg Kroah-Hartman
2013-07-11 22:19 ` [ 06/15] hpfs: better test for errors Greg Kroah-Hartman
2013-07-11 22:19 ` [ 07/15] block: do not pass disk names as format strings Greg Kroah-Hartman
2013-07-11 22:19 ` [ 08/15] crypto: sanitize argument for format string Greg Kroah-Hartman
2013-07-11 22:19 ` [ 09/15] MAINTAINERS: add stable_kernel_rules.txt to stable maintainer information Greg Kroah-Hartman
2013-07-11 22:19 ` [ 10/15] futex: Take hugepages into account when generating futex_key Greg Kroah-Hartman
2013-07-11 22:19 ` [ 11/15] Revert "serial: 8250_pci: add support for another kind of NetMos Technology PCI 9835 Multi-I/O Controller" Greg Kroah-Hartman
2013-07-11 22:19 ` [ 12/15] nfsd4: fix decoding of compounds across page boundaries Greg Kroah-Hartman
2013-07-11 22:19 ` [ 13/15] KVM: VMX: mark unusable segment as nonpresent Greg Kroah-Hartman
2013-07-11 22:19 ` [ 14/15] SCSI: sd: Fix parsing of temporary cache mode prefix Greg Kroah-Hartman
2013-07-11 22:19 ` Greg Kroah-Hartman [this message]
2013-07-12 17:23 ` [ 00/15] 3.9.10-stable review Shuah Khan
2013-07-12 22:05 ` Guenter Roeck
2013-07-13  1:32   ` Greg Kroah-Hartman
2013-07-13  4:16 ` Satoru Takeuchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130711221257.646563383@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=glommer@openvz.org \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mhocko@suse.cz \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).