From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 18 May 2018 11:02:12 +0200 (CEST) Received: from mail.kernel.org ([198.145.29.99]:39398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23994562AbeERJCFShfLK (ORCPT ); Fri, 18 May 2018 11:02:05 +0200 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0A21320834; Fri, 18 May 2018 09:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526634118; bh=1SRWfoD/psW265W0vT6SkEYVwFaJZV//o8sPscC1Ots=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yG3qvLwRGv7O+CGbyHALAoDhrv5hXvUquGE09lGU2oBdq7COnfz28qPQxLWrVQ8LY 7g602wZdp5Z08Kb70DWy7zYY4LLYiFL+qCl6pJGo25Hgf2g0+xQRzXMmzkbqG28ksx 4ZQvckvd4d6AA4/uXwbmgAeh2c99asU7GZdxE3J8= Date: Fri, 18 May 2018 11:01:41 +0200 From: Greg Kroah-Hartman To: Jiri Slaby Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Thomas Gleixner , Russell King , "Darren Hart (VMware)" , linux-mips@linux-mips.org, Rich Felker , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, peterz@infradead.org, Benjamin Herrenschmidt , Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, Jonas Bonn , linux-s390@vger.kernel.org, linux-arch@vger.kernel.org, Yoshinori Sato , linux-hexagon@vger.kernel.org, Helge Deller , "James E.J. Bottomley" , Catalin Marinas , Matt Turner , linux-snps-arc@lists.infradead.org, Fenghua Yu , Arnd Bergmann , linux-xtensa@linux-xtensa.org, Stefan Kristiansson , openrisc@lists.librecores.org, Ivan Kokshaysky , Stafford Horne , linux-arm-kernel@lists.infradead.org, Richard Henderson , Chris Zankel , Michal Simek , Tony Luck , linux-parisc@vger.kernel.org, Vineet Gupta , Ralf Baechle , Richard Kuo , linux-alpha@vger.kernel.org, Martin Schwidefsky , linuxppc-dev@lists.ozlabs.org, "David S. Miller" , Ben Hutchings Subject: Re: [PATCH 4.9 27/33] futex: Remove duplicated code and fix undefined behaviour Message-ID: <20180518090141.GA10227@kroah.com> References: <20180518081535.096308218@linuxfoundation.org> <20180518081536.166573281@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 63989 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: gregkh@linuxfoundation.org Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips On Fri, May 18, 2018 at 10:30:24AM +0200, Jiri Slaby wrote: > On 05/18/2018, 10:16 AM, Greg Kroah-Hartman wrote: > > 4.9-stable review patch. If anyone has any objections, please let me know. > > > > ------------------ > > > > From: Jiri Slaby > > > > commit 30d6e0a4190d37740e9447e4e4815f06992dd8c3 upstream. > ... > > --- a/kernel/futex.c > > +++ b/kernel/futex.c > > @@ -1458,6 +1458,45 @@ out: > > return ret; > > } > > > > +static int futex_atomic_op_inuser(unsigned int encoded_op, u32 __user *uaddr) > > +{ > > + unsigned int op = (encoded_op & 0x70000000) >> 28; > > + unsigned int cmp = (encoded_op & 0x0f000000) >> 24; > > + int oparg = sign_extend32((encoded_op & 0x00fff000) >> 12, 12); > > + int cmparg = sign_extend32(encoded_op & 0x00000fff, 12); > > 12 is wrong here – wherever you apply this, you need also a follow-up fix: > commit d70ef22892ed6c066e51e118b225923c9b74af34 > Author: Jiri Slaby > Date: Thu Nov 30 15:35:44 2017 +0100 > > futex: futex_wake_op, fix sign_extend32 sign bits Thanks for letting me know, I've now queued it up to the needed trees. greg k-h