From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757180AbbJIJ60 (ORCPT ); Fri, 9 Oct 2015 05:58:26 -0400 Received: from smtp05.mail.online.nl ([194.134.25.75]:19884 "EHLO smtp05.mail.online.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757123AbbJIJ6Y convert rfc822-to-8bit (ORCPT ); Fri, 9 Oct 2015 05:58:24 -0400 X-Greylist: delayed 507 seconds by postgrey-1.27 at vger.kernel.org; Fri, 09 Oct 2015 05:58:23 EDT Subject: Re: [RFC]: Possible race condition in kernel futex code Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: text/plain; charset=us-ascii From: Hans Zuidam In-Reply-To: Date: Fri, 9 Oct 2015 11:49:45 +0200 Cc: Jaccon Bastiaansen , x86@kernel.org, mingo@redhat.com, "H. Peter Anvin" , Peter Zijlstra , "linux-kernel@vger.kernel.org" , stable@vger.kernel.org Reply-To: Hans Zuidam Content-Transfer-Encoding: 8BIT Message-Id: <4387EFE3-55AB-433B-83E1-2AFC413C7B9A@online.nl> References: To: Thomas Gleixner X-Mailer: Apple Mail (2.1878.6) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, On 9 okt. 2015, at 11:06, Thomas Gleixner wrote: On Mon, 5 Oct 2015, Jaccon Bastiaansen wrote: >> We did some tests with different compilers, kernel versions and kernel >> configs, with the following results: > 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. Although none of the compiler/kernel combinations we have tried showed this happening, we think it is probably better to be safe than sorry. With kind regards, Hans Zuidam