Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755162Ab1FHPWV (ORCPT ); Wed, 8 Jun 2011 11:22:21 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:60181 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756391Ab1FHPWS (ORCPT ); Wed, 8 Jun 2011 11:22:18 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=kY1chVfS8XSHzOke/6eH3EkHJgziBpFsn7lL/eN2OFX9yJ/QFBo7PzYOTZrWDrdMCE syFpubud+KtH60X1R+dBjU/Rq0HBYAjKzFHNxdSEmY6kxG/ZujegiGslJcjjtyzV2bZu AgKJkyP5YqKOfnNWH263JVKbRYtl3FMSOOIcM= MIME-Version: 1.0 In-Reply-To: References: <1307373819.3098.40.camel@edumazet-laptop> <1307376672.2322.167.camel@twins> <1307376989.2322.171.camel@twins> <1307377349.3098.65.camel@edumazet-laptop> <1307377782.2322.183.camel@twins> <1307378564.3098.67.camel@edumazet-laptop> <4DED1421.5000300@linux.intel.com> <1307383898.3098.90.camel@edumazet-laptop> <4DED976C.90009@linux.intel.com> <4DEE3944.5020005@mit.edu> <1307462300.3091.39.camel@edumazet-laptop> From: Andrew Lutomirski Date: Wed, 8 Jun 2011 11:21:58 -0400 X-Google-Sender-Auth: dhCCz866vbSHfl41lECjaasi2w8 Message-ID: Subject: Re: Change in functionality of futex() system call. To: David Oliver Cc: Kyle Moffett , Eric Dumazet , Darren Hart , Peter Zijlstra , linux-kernel@vger.kernel.org, Shawn Bohrer , Zachary Vonler , KOSAKI Motohiro , Hugh Dickins , Thomas Gleixner , Ingo Molnar Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1733 Lines: 40 On Wed, Jun 8, 2011 at 11:20 AM, David Oliver wrote: > > Having a new call is inelegant from a futex(2) user perspective, as > the need for a change is due to the kernel implementation and/or mutex > requirements. The futex() system call, as documented, is ideal for a > single producer to signal multiple receivers of state updates. > > If it is truly necessary to add new variants to futex() to protect > applications that allow untrusted applications read access to their > mutexes, I would avoid both the names suggested, as consumption of > wakeups is not an obvious issue to users, and POLL suggests waiting > for multiple entities as in poll(2) (which is not provided), or > returning immediately (which is orthogonally provided by the timeout > parameter). What is being provided from the user point of view is a > FUTEX_WAIT per the man page, which doesn't require write access. How > about FUTEX_WAIT_RDONLY? That name sounds good. > > Alternatively, use the current call and document that when process > performing a FUTEX_WAIT on read-only memory are woken, they do not > count towards the number reported as being woken. I don't see anything wrong with that, either. > > Best, IMHO, would be to document that providing read access to mutexes > to untrusted software is unsafe behavior, and restore read only access > to readers of futexes. I think it should be safe, and it would be easy to make it be safe (i.e. make no changes at all). --Andy -- 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/