Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp272958pxf; Wed, 10 Mar 2021 06:12:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxY5ErglSVWxbsSB5fy3cNSoVe3FvYnc/Fi610zjwyH8HDC8MtI3WHFOratHuLLqMCszwIs X-Received: by 2002:a05:6402:30a5:: with SMTP id df5mr3572716edb.24.1615385526507; Wed, 10 Mar 2021 06:12:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615385526; cv=none; d=google.com; s=arc-20160816; b=JDHd/iqmj4qyddnJNI5Lv1mAEAkwr6LgJtHAavq9ltSPcbQ4RM7R4+FFTghR1uWzQF hOhV6nmHqtSRNlQ3kPVrQAzaHOL5yCHjq3j8Fvh46Ot4uLAKWSRkNuY+IGAZgPT0zxez LTgmE1nc+IS0X6HfRnNVn8OwfmWLvZL2mtWtf+4t9e7UfeJ1u4dB3aLLGAvx3iAENpX0 /L7MGzGGoWZbCMfIw1aocGSB4PYcy9VUOXhqEF2GiTK1o1DTzEidxrVoQc1536X7xCOF NegK+v4bBTf9B2jcGTNCj+UZOpHnqaOvUWrXmBIC6sP3KrAPIO3vItu4kfGNu6fwBg24 qqvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=YjMDuH+6DqW9TsjZ3f4VrlJbUJzi8E9B7VkWg1er1+M=; b=ty7HeCAYfVDXcdpt36+CEoxXYuY6Qx9QieEJ3NNj6U2nXM3flU3bCpP4jcmT+1LALo vXjDrpaHDzFcR5LSoWZ3HQC+TNt0/+Zy5WlMRmH84ods/B8R+X3/KLPQjiEW/73NyLT5 183pgTL4QRFStGfI7kq4Vm5bngcyRAApBXg7WZCVas3ZPYWYMAHK8YJuBtsm4AQx+C02 wcSdAb5f5e0xx854CHEOQddIbO+92FmjjnQDff1TWd2sld9nh5k6pfYhWq0dMiItkvO1 d4QhK6fS365ezX1g1i7j5FqG48atmkL42wvd0fpj4R1wBsuvb3agq2zPps32URzOxesu uDUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FqprEAQp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si11860921ejy.135.2021.03.10.06.11.44; Wed, 10 Mar 2021 06:12:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FqprEAQp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232408AbhCJOKn (ORCPT + 99 others); Wed, 10 Mar 2021 09:10:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:34876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbhCJOKa (ORCPT ); Wed, 10 Mar 2021 09:10:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 56C9664FE5; Wed, 10 Mar 2021 14:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615385429; bh=GYtxc/KBm2cPeRcQrsmKZtpPqvdeQbsvassH5zzBcDY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=FqprEAQpNAeSL3uf1wXwOsfuMotV5siUk690EudW5RO1US9S6oATADtPT+evDbHlk PKECzLB0fPO8hBbIxCB9AHN5HfdynZUFgIb9ulFCjFl3sW+L0GcC+GQ08DZ+Uem29Y +Lkiut7/RZA06RukoKxA0E3uP4KxI1uMYwjram8U= Date: Wed, 10 Mar 2021 15:10:27 +0100 From: Greg KH To: Lee Jones , Zheng Yejian , stable@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, cj.chengjian@huawei.com, judy.chenhui@huawei.com, zhangjinhao2@huawei.com, nixiaoming@huawei.com Subject: Re: [PATCH 4.4 3/3] futex: fix dead code in attach_to_pi_owner() Message-ID: References: <20210309030605.3295183-1-zhengyejian1@huawei.com> <20210309030605.3295183-4-zhengyejian1@huawei.com> <20210309181437.GV4931@dell> <20210310132802.GP701493@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210310132802.GP701493@dell> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 10, 2021 at 01:28:02PM +0000, Lee Jones wrote: > On Wed, 10 Mar 2021, Greg KH wrote: > > > On Tue, Mar 09, 2021 at 06:14:37PM +0000, Lee Jones wrote: > > > On Tue, 09 Mar 2021, Greg KH wrote: > > > > > > > On Tue, Mar 09, 2021 at 11:06:05AM +0800, Zheng Yejian wrote: > > > > > From: Thomas Gleixner > > > > > > > > > > The handle_exit_race() function is defined in commit 9c3f39860367 > > > > > ("futex: Cure exit race"), which never returns -EBUSY. This results > > > > > in a small piece of dead code in the attach_to_pi_owner() function: > > > > > > > > > > int ret = handle_exit_race(uaddr, uval, p); /* Never return -EBUSY */ > > > > > ... > > > > > if (ret == -EBUSY) > > > > > *exiting = p; /* dead code */ > > > > > > > > > > The return value -EBUSY is added to handle_exit_race() in upsteam > > > > > commit ac31c7ff8624409 ("futex: Provide distinct return value when > > > > > owner is exiting"). This commit was incorporated into v4.9.255, before > > > > > the function handle_exit_race() was introduced, whitout Modify > > > > > handle_exit_race(). > > > > > > > > > > To fix dead code, extract the change of handle_exit_race() from > > > > > commit ac31c7ff8624409 ("futex: Provide distinct return value when owner > > > > > is exiting"), re-incorporated. > > > > > > > > > > Lee writes: > > > > > > > > > > This commit takes the remaining functional snippet of: > > > > > > > > > > ac31c7ff8624409 ("futex: Provide distinct return value when owner is exiting") > > > > > > > > > > ... and is the correct fix for this issue. > > > > > > > > > > Fixes: 9c3f39860367 ("futex: Cure exit race") > > > > > Cc: stable@vger.kernel.org # v4.9.258 > > > > > Signed-off-by: Xiaoming Ni > > > > > Reviewed-by: Lee Jones > > > > > Signed-off-by: Greg Kroah-Hartman > > > > > Signed-off-by: Zheng Yejian > > > > > --- > > > > > kernel/futex.c | 6 +++--- > > > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > > > > > Same here, what is the upstream git id? > > > > > > It doesn't have one as such - it's a part-patch: > > > > > > > > This commit takes the remaining functional snippet of: > > > > > > > > > > ac31c7ff8624409 ("futex: Provide distinct return value when owner is exiting") > > > > That wasn't obvious :( > > This was also my thinking, which is why I replied to the original > patch in an attempt to clarify what I thought was happening. > > > Is this a backport of another patch in the stable tree somewhere? > > Yes, it looks like it. > > The full patch was back-ported to v4.14 as: > > e6e00df182908f34360c3c9f2d13cc719362e9c0 Ok, Zheng, can you put this information in the patch and resend the whole series? thanks, greg k-h