Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932653AbZJEK5a (ORCPT ); Mon, 5 Oct 2009 06:57:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932630AbZJEK5a (ORCPT ); Mon, 5 Oct 2009 06:57:30 -0400 Received: from www.tglx.de ([62.245.132.106]:54718 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932609AbZJEK53 (ORCPT ); Mon, 5 Oct 2009 06:57:29 -0400 Date: Mon, 5 Oct 2009 12:56:41 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Anirban Sinha , Ingo Molnar , linux-kernel@vger.kernel.org, Darren Hart , Kaz Kylheku , Anirban Sinha Subject: Re: futex question In-Reply-To: <1254738974.26976.24.camel@twins> Message-ID: References: <20091001092218.GH15345@elte.hu> <4AC68F13.8050601@us.ibm.com> <4AC8CF32.8060108@anirban.org> <1254738974.26976.24.camel@twins> User-Agent: Alpine 2.00 (LFD 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: 1409 Lines: 41 Peter, On Mon, 5 Oct 2009, Peter Zijlstra wrote: > On Sun, 2009-10-04 at 18:59 +0200, Thomas Gleixner wrote: > > > > do. It does not feel right. Currently, with or without my change, > > > such a thing would indefinitely block other waiters on the same > > > futex. > > > > Right. Which completely defeats the purpose of the robust list. Will > > have a look tomorrow. > > Right, so mm_release() which is meant to destroy the old mm context > actually does exit_robust_list(), but the problem is that it does so on > the new mm, not the old one that got passed down to mm_release(). > > The other detail is that exit_robust_list() doesn't clear > current->robust_list. I know. > The problem with the patch send my Ani is that it clears the robust > lists before the point of no return, so on a failing execve() we'd have > messed up the state. Right. We need to do that at the latest possible point. Looking more into that I think we should check whether the robust list has an entry (lock held) in do_execve() and return -EWOULDBLOCK to luser space. Same if pi_waiters is not empty. Holding a lock and calling execve() is simply broken. Thanks, tglx -- 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/