Received: by 10.223.176.46 with SMTP id f43csp2214982wra; Thu, 25 Jan 2018 06:40:32 -0800 (PST) X-Google-Smtp-Source: AH8x224C9dizSUTFhHOoDGuzrOeUheHOhi0kGnr/NbF1isDnGJUKbjRXJWdSPWMJwZ1XHgCCwrqf X-Received: by 2002:a17:902:5a41:: with SMTP id f1-v6mr11661101plm.201.1516891232166; Thu, 25 Jan 2018 06:40:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516891232; cv=none; d=google.com; s=arc-20160816; b=hSntaH4U6TZeO2EjcUrqhrvnViLaTLcf0Y55ifr9DHsG+yFom6B7iN6LYOHYIVvoxo cNW0qgoRKuF5wsiDZL4pfVdKBFWzHTMcmBD0Jfi30LtHSFqU/L71KPxyw9+4FbeteOq+ AvCXOq1OD+6nye4tJeXGMGDqMbBzlbxwesO6XJKauqqA/QG3X7dRuEbKIpybPWluUDv4 XK5KQdE5jVCM9E06jc1XU3c+uliJK2E+wFWwG0OTfqeN5xn3ht9AONts4t7pUHymfu8B q36IgED9ZvTetOrTcbLLXQkTAA48/STfjEQtxZF3U+d3MsYhZ4P5fcU/iFLW5BY+gchs Rreg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=NZ3/lVeOPzfhnbUgfBrwbm6Msf+0D5CW4xgUxgW92LM=; b=jZdftL6VPeheYuGjnW05xihd7BxQkreWs30GpQy5dxSwcwDH3CQKnIhQ2TKm6vEMEb 3DzZXTfueEQy/YTTMEC9TLlkwGMYSI+gGksBhwbhCmuvjQAWh/TSlCAMICvIZUVRBuPM 7rKhngMDVgMgdKEucIwiUy+p4XsYUe3vQppuhwC10ttYzEc9apEbxOcJ3sw7TcmmDHIE IpmIcH20ZUKTjaXb7RiRgcBNgfF9qxCZXsnn3C4vtG/f+NorPuaHN4uJKMEn8kzYsuRV lfdOpFKRu/BxWqjneZRJicNb3o1g2Kw0rSrifd+Az4x/lj/Fry5dTTeVKYqstgYB3UxI R8Og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l185si1649652pge.147.2018.01.25.06.40.18; Thu, 25 Jan 2018 06:40:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751630AbeAYOam (ORCPT + 99 others); Thu, 25 Jan 2018 09:30:42 -0500 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 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1eeiVO-0002b5-No; Thu, 25 Jan 2018 15:27:54 +0100 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> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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