From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx173.postini.com [74.125.245.173]) by kanga.kvack.org (Postfix) with SMTP id BB28A6B004A for ; Fri, 24 Feb 2012 11:54:17 -0500 (EST) Date: Fri, 24 Feb 2012 10:54:15 -0600 (CST) From: Christoph Lameter Subject: Re: [RFC][PATCH] fix move/migrate_pages() race on task struct In-Reply-To: <4F47BF56.6010602@linux.vnet.ibm.com> Message-ID: References: <20120223180740.C4EC4156@kernel> <4F468F09.5050200@linux.vnet.ibm.com> <4F469BC7.50705@linux.vnet.ibm.com> <4F47BF56.6010602@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Dave Hansen Cc: "Eric W. Biederman" , linux-kernel@vger.kernel.org, linux-mm@kvack.org On Fri, 24 Feb 2012, Dave Hansen wrote: > On 02/24/2012 07:20 AM, Christoph Lameter wrote: > > Subject: migration: Do not do rcu_read_unlock until the last time we need the task_struct pointer > > > > Migration functions perform the rcu_read_unlock too early. As a result the > > task pointed to may change. Bugs were introduced when adding security checks > > because rcu_unlock/lock sequences were inserted. Plus the security checks > > and do_move_pages used the task_struct pointer after rcu_unlock. > > > > Fix those issues by removing the unlock/lock sequences and moving the > > rcu_read_unlock after the last use of the task struct pointer. > > > > Signed-off-by: Christoph Lameter > > It doesn't fix the code duplication, but it definitely does fix the bug Yes I did not want to override all your good work. Could you do another patch that removed the duplication? -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org