From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from Galois.linutronix.de ([146.0.238.70]:35259 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbeAYOal (ORCPT ); Thu, 25 Jan 2018 09:30:41 -0500 Date: Thu, 25 Jan 2018 15:30:36 +0100 (CET) From: Thomas Gleixner To: Jiri Slaby cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Li Jinyue , peterz@infradead.org, dvhart@infradead.org Subject: Re: [PATCH 4.14 17/89] futex: Prevent overflow by strengthen input validation In-Reply-To: Message-ID: References: <20180122083954.683903493@linuxfoundation.org> <20180122083956.427607580@linuxfoundation.org> <20567b49-e0a3-e9e0-d520-74bbfc20d414@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: stable-owner@vger.kernel.org List-ID: On Thu, 25 Jan 2018, Jiri Slaby wrote: > On 01/25/2018, 03:03 PM, Thomas Gleixner wrote: > > On Thu, 25 Jan 2018, Jiri Slaby wrote: > >> On 01/22/2018, 09:44 AM, Greg Kroah-Hartman wrote: > >>> + if (nr_wake < 0 || nr_requeue < 0) > >>> + return -EINVAL; > >> > >> This breaks strace's test suite on 4.14.15 (and is present in upstream > >> obviously too): > >> futex(0x7ff568b44ffc, 0x3, 0xfacefeed, 0xbadda7a0ca7b100d, > >> 0x7ff568b44ffc, 0x9caffee1) = -1: Invalid argument > > > > And why the hell is strace expecting this to be valid? > > You ought to ask somebody else, I was confused the very same way: > > My FIX: > https://github.com/strace/strace/pull/16/commits/777587ea509481666274df88671949b390f05cc3 > > Their NACK: > https://github.com/strace/strace/pull/16#issuecomment-341614984 https://github.com/strace/strace/commit/79d10dfc20985225e4ea044d3875c4cea09053d7 Update futex test in accordance with kernel's v4.15-rc7-202-gfbe0e83 * futex.c (VALP, VALP_PR, VAL2P, VAL2P_PR): New macro definitions. (main): Allow EINVAL on *REQUEUE* checks with VAL/VAL2 with higher bit being set, check that the existing behaviour preserved with VALP/VAL2P where higher bit is unset. So what's the problem? Thanks, tglx