From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965216AbbJILgl (ORCPT ); Fri, 9 Oct 2015 07:36:41 -0400 Received: from casper.infradead.org ([85.118.1.10]:54901 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758251AbbJILf5 (ORCPT ); Fri, 9 Oct 2015 07:35:57 -0400 Date: Fri, 9 Oct 2015 13:35:52 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: Hans Zuidam , Jaccon Bastiaansen , x86@kernel.org, mingo@redhat.com, "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , stable@vger.kernel.org, Linus Torvalds Subject: Re: [RFC]: Possible race condition in kernel futex code Message-ID: <20151009113552.GC3816@twins.programming.kicks-ass.net> References: <4387EFE3-55AB-433B-83E1-2AFC413C7B9A@online.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 09, 2015 at 11:25:09AM +0100, Thomas Gleixner wrote: > Hans, > > On Fri, 9 Oct 2015, Hans Zuidam wrote: > > On 9 okt. 2015, at 11:06, Thomas Gleixner wrote: > > > You cannot use an explicit 32bit read. We need an access which > > > handles the fault gracefully. > > > > The reason for the explicit read suggestion is to avoid the > > _builtin_constant_p() in __copy_from_user_nocheck(). The GCC manual > > says that there may be situations where it returns 0 even though the > > argument is a constant. > > That's insane at best. Right, but I bet that is for cases where constant propagation completely fails, and this is a trivial case, I have no problem relying on it.