Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934588AbZLGAcD (ORCPT ); Sun, 6 Dec 2009 19:32:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934574AbZLGAbq (ORCPT ); Sun, 6 Dec 2009 19:31:46 -0500 Received: from kroah.org ([198.145.64.141]:34320 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758393AbZLGAMy (ORCPT ); Sun, 6 Dec 2009 19:12:54 -0500 X-Mailbox-Line: From gregkh@mini.kroah.org Sun Dec 6 16:06:46 2009 Message-Id: <20091207000646.002713921@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Sun, 06 Dec 2009 16:00:11 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Balbir Singh , KAMEZAWA Hiroyuki Subject: [035/119] memcg: fix wrong pointer initialization at page migration when memcg is disabled. References: <20091206235936.208334321@mini.kroah.org> Content-Disposition: inline; filename=memcg-fix-wrong-pointer-initialization-at-page-migration-when-memcg-is-disabled.patch In-Reply-To: <20091207000938.GA24743@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1646 Lines: 40 2.6.31-stable review patch. If anyone has any objections, please let us know. ------------------ From: KAMEZAWA Hiroyuki commit e00e431612c3a6e437a01f2129fd3843da0c982a upstream. Lee Schermerhorn reported that he saw bad pointer dereference in mem_cgroup_end_migration() when he disabled memcg by boot option. memcg's page migration logic works as mem_cgroup_prepare_migration(page, &ptr); do page migration mem_cgroup_end_migration(page, ptr); Now, ptr is not initialized in prepare_migration when memcg is disabled by boot option. This causes panic in end_migration. This patch fixes it. Reported-by: Lee Schermerhorn Cc: Balbir Singh Signed-off-by: KAMEZAWA Hiroyuki Reviewed-by: Daisuke Nishimura Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/migrate.c +++ b/mm/migrate.c @@ -597,7 +597,7 @@ static int unmap_and_move(new_page_t get struct page *newpage = get_new_page(page, private, &result); int rcu_locked = 0; int charge = 0; - struct mem_cgroup *mem; + struct mem_cgroup *mem = NULL; if (!newpage) return -ENOMEM; -- 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/