From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx107.postini.com [74.125.245.107]) by kanga.kvack.org (Postfix) with SMTP id 63C906B0044 for ; Mon, 5 Nov 2012 15:13:13 -0500 (EST) Received: by mail-pb0-f41.google.com with SMTP id rq2so4559992pbb.14 for ; Mon, 05 Nov 2012 12:13:12 -0800 (PST) MIME-Version: 1.0 Date: Tue, 6 Nov 2012 01:43:12 +0530 Message-ID: Subject: [PATCH] mm: bugfix: set current->reclaim_state to NULL while returning from kswapd() From: Aaditya Kumar Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: LKML , linux-mm@kvack.org Cc: kosaki.motohiro@jp.fujitsu.com, KAMEZAWA Hiroyuki , KOSAKI Motohiro , Mel Gorman , akpm@linux-foundation.org, Minchan Kim , takamori.yamaguchi@jp.sony.com, takuzo.ohara@ap.sony.com, amit.agarwal@ap.sony.com, tim.bird@am.sony.com, frank.rowand@am.sony.com, kan.iibuchi@jp.sony.com, aaditya.kumar@ap.sony.com From: Takamori Yamaguchi In kswapd(), set current->reclaim_state to NULL before returning, as current->reclaim_state holds reference to variable on kswapd()'s stack. In rare cases, while returning from kswapd() during memory off lining, __free_slab() can access dangling pointer of current->reclaim_state. Signed-off-by: Takamori Yamaguchi Signed-off-by: Aaditya Kumar --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 2624edc..8b055e9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3017,6 +3017,8 @@ static int kswapd(void *p) &balanced_classzone_idx); } } + + current->reclaim_state = NULL; return 0; } -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org