Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757843Ab2BXQyT (ORCPT ); Fri, 24 Feb 2012 11:54:19 -0500 Received: from smtp103.prem.mail.ac4.yahoo.com ([76.13.13.42]:48201 "HELO smtp103.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753007Ab2BXQyS (ORCPT ); Fri, 24 Feb 2012 11:54:18 -0500 X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: HY2XSCMVM1mz2pUuj4Ep8LTuGTQFI1vq7nWxFHYvcjzxTSd D48oJaKvhEvJLkiP2M.r3W1bFoMoYzPhYI8Kc3Jf9IYz2kkHKN.6lGu3MFnT YB.sv4Suf8w12Mn9W2rtS993QsctaZ5jvDycY_ecWl9xNI1Q7k570m3Q8ZQK tZ9mWf4khSMPNYMvSNAqrQwq_wyw9YcaZOAYT.h9lkUvrCR9TVblaQZ9pDbZ Iyb7jOtpWsZ3JyoSy5D0JeLeLDkDga4O2zYRV809OeS0tl0IeKqnJViQ0JSR GOdXqKGAc.Pd8XGxTdBrIQsGiqpBdQtUJM0tznjy7UfM565puNuZSSpqSIoN oUGUWFX6cf4I7ok1j_Nkq5oYvbZpVAUe0kVR.SEAP4t4uasRmFaW4Ykix5DB 4 X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- Date: Fri, 24 Feb 2012 10:54:15 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@router.home To: Dave Hansen cc: "Eric W. Biederman" , linux-kernel@vger.kernel.org, linux-mm@kvack.org 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> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1138 Lines: 26 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 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/