From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx184.postini.com [74.125.245.184]) by kanga.kvack.org (Postfix) with SMTP id 6BE566B0009 for ; Thu, 28 Feb 2013 00:25:32 -0500 (EST) Received: by mail-qe0-f45.google.com with SMTP id b4so1145015qen.32 for ; Wed, 27 Feb 2013 21:25:31 -0800 (PST) From: kosaki.motohiro@gmail.com Subject: [PATCH 1/2] mempolicy: fix wrong sp_node insertion Date: Thu, 28 Feb 2013 00:25:06 -0500 Message-Id: <1362029107-3908-1-git-send-email-kosaki.motohiro@gmail.com> In-Reply-To: References: Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Sasha Levin , Andrew Morton , Hugh Dickins , Mel Gorman , Dave Jones , Hillf Danton , KOSAKI Motohiro From: KOSAKI Motohiro From: Hillf Danton n->end is accessed in sp_insert(). Thus it should be update before calling sp_insert(). This mistake may make kernel panic. Signed-off-by: Hillf Danton Signed-off-by: KOSAKI Motohiro --- mm/mempolicy.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 31d2663..868d08f 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2391,8 +2391,8 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start, *mpol_new = *n->policy; atomic_set(&mpol_new->refcnt, 1); sp_node_init(n_new, n->end, end, mpol_new); - sp_insert(sp, n_new); n->end = start; + sp_insert(sp, n_new); n_new = NULL; mpol_new = NULL; break; -- 1.7.1 -- 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