From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22965C433DB for ; Thu, 25 Feb 2021 06:31:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6CB764EBA for ; Thu, 25 Feb 2021 06:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233706AbhBYGb2 (ORCPT ); Thu, 25 Feb 2021 01:31:28 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:13377 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233536AbhBYGb0 (ORCPT ); Thu, 25 Feb 2021 01:31:26 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DmNBr0G4dz7kKg; Thu, 25 Feb 2021 14:28:04 +0800 (CST) Received: from [10.67.110.218] (10.67.110.218) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Thu, 25 Feb 2021 14:29:33 +0800 Subject: Re: [PATCH 4.9.y 1/1] futex: Fix OWNER_DEAD fixup To: Lee Jones CC: , , , , , , References: <20210223144151.916675-1-zhengyejian1@huawei.com> <20210223144151.916675-2-zhengyejian1@huawei.com> <20210224111915.GA641347@dell> From: "Zhengyejian (Zetta)" Message-ID: <09cd79ce-291a-1750-6954-ecde0a6bdfcf@huawei.com> Date: Thu, 25 Feb 2021 14:29:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210224111915.GA641347@dell> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.110.218] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/24 19:19, Lee Jones wrote: > On Tue, 23 Feb 2021, Zheng Yejian wrote: > >> From: Peter Zijlstra >> >> commit a97cb0e7b3f4c6297fd857055ae8e895f402f501 upstream. >> >> Both Geert and DaveJ reported that the recent futex commit: >> >> c1e2f0eaf015 ("futex: Avoid violating the 10th rule of futex") >> >> introduced a problem with setting OWNER_DEAD. We set the bit on an >> uninitialized variable and then entirely optimize it away as a >> dead-store. >> >> Move the setting of the bit to where it is more useful. >> >> Reported-by: Geert Uytterhoeven >> Reported-by: Dave Jones >> Signed-off-by: Peter Zijlstra (Intel) >> Cc: Andrew Morton >> Cc: Linus Torvalds >> Cc: Paul E. McKenney >> Cc: Peter Zijlstra >> Cc: Thomas Gleixner >> Fixes: c1e2f0eaf015 ("futex: Avoid violating the 10th rule of futex") >> Link: http://lkml.kernel.org/r/20180122103947.GD2228@hirez.programming.kicks-ass.net >> Signed-off-by: Ingo Molnar >> Signed-off-by: Zheng Yejian > > Why have you dropped my Reviewed-by? > Really sorry. I thought that a changed patchset needs another review. Then I do need to append your Reviewed-by and send a "V2" patchset, Do I? >> --- >> kernel/futex.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/kernel/futex.c b/kernel/futex.c >> index b65dbb5d60bb..604d1cb9839d 100644 >> --- a/kernel/futex.c >> +++ b/kernel/futex.c >> @@ -2424,9 +2424,6 @@ static int __fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, >> int err = 0; >> >> oldowner = pi_state->owner; >> - /* Owner died? */ >> - if (!pi_state->owner) >> - newtid |= FUTEX_OWNER_DIED; >> >> /* >> * We are here because either: >> @@ -2484,6 +2481,9 @@ static int __fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q, >> } >> >> newtid = task_pid_vnr(newowner) | FUTEX_WAITERS; >> + /* Owner died? */ >> + if (!pi_state->owner) >> + newtid |= FUTEX_OWNER_DIED; >> >> if (get_futex_value_locked(&uval, uaddr)) >> goto handle_fault; >