Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1739456ybg; Thu, 4 Jun 2020 18:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbiEj6JgUcLDtI7P6KE82/yZaB6gwf+pC298HYL5D9Fcm8/+ZEL/3Hr8uuj++qm/bcXwU6 X-Received: by 2002:a05:6402:6c6:: with SMTP id n6mr6742043edy.277.1591320554055; Thu, 04 Jun 2020 18:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591320554; cv=none; d=google.com; s=arc-20160816; b=Qw3+4ily6nhWAdgC9ZYWl67OYCTmzlCdH9LafSl8Cm2oy52Vti/DAXlYs1hwCf+SF4 L4vAMMPBMEq7nmLuD9ncwL3rWA15FxZjAH35+2nwbrZZ0O+KSay054z4D18XidJcKkxG 4sGeUKaim9eBFfApyfDRV6RuHNCnUJPtPsKJBSAsX+QsymNiM5C7GGizFZOIPtF0x18B 7WxDi8I+7qSXGDIFRTxjEmjX19eQafPbG61r0nm/2hXky9YuO/y0PQvVtcTzvzKyBntx ynDkc+d2JYFa1bdZXG3unjg8jqtVd+R0ZHw89DqnDjQWo/+rXkej2FNkecy0svpA5rxq b45w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=wK2A1ax22QK8kuLfT0xtqHnzJC0x0cGm4ZvB/kvO0Y4=; b=ZlRbhTacREq2LgKuQYrwK/u4y868HI+hn/T9CKB3wgaEmF8b0JFI/Q7dy0tJn/tpIR GlKC08XG8XRugHkVZY2TrYLeV8f6WCTwvRV2UZuuf+8x3thmiLDXQwSyBs3EjfmkS+AU KELXGdFYB9Tk1t6u/xpBBos0KW8sK4oFwXaiUmZiBN+KTaWjk1+tegNDVFwTbsdmJQGc R8k5IkODZOm9PSj4iA2HwdxnlyCJA6C6YAQRLok8Ay+MB4Txg/IzDzLHdCdl5F5zAz6t 1XKL1xNDJksWJ1A9KOdBRfwRagrM7Zmo6BOMd2ntEI6jKjBN9ZikK2qGIJk2bXexHbQ9 HDpg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si2603496edn.18.2020.06.04.18.28.50; Thu, 04 Jun 2020 18:29:14 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726134AbgFEB05 (ORCPT + 99 others); Thu, 4 Jun 2020 21:26:57 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5854 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725863AbgFEB05 (ORCPT ); Thu, 4 Jun 2020 21:26:57 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E8A6B1303D2CBD83AA15; Fri, 5 Jun 2020 09:26:54 +0800 (CST) Received: from [127.0.0.1] (10.166.213.10) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Fri, 5 Jun 2020 09:26:44 +0800 Subject: Re: Question: livepatch failed for new fork() task stack unreliable To: Josh Poimboeuf CC: , , , , , , , , , , References: <20200529101059.39885-1-bobo.shaobowang@huawei.com> <20200529174433.wpkknhypx2bmjika@treble> <20200601180538.o5agg5trbdssqken@treble> <20200602131450.oydrydelpdaval4h@treble> <1353648b-f3f7-5b8d-f0bb-28bdb1a66f0f@huawei.com> <20200603153358.2ezz2pgxxxld7mj7@treble> <2225bc83-95f2-bf3d-7651-fdd10a3ddd00@huawei.com> <20200604024051.6ovbr6tbrowwg6jr@treble> From: "Wangshaobo (bobo)" Message-ID: Date: Fri, 5 Jun 2020 09:26:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20200604024051.6ovbr6tbrowwg6jr@treble> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.166.213.10] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/6/4 10:40, Josh Poimboeuf 写道: > On Thu, Jun 04, 2020 at 09:24:55AM +0800, Wangshaobo (bobo) wrote: >> 在 2020/6/3 23:33, Josh Poimboeuf 写道: >>> On Wed, Jun 03, 2020 at 10:06:07PM +0800, Wangshaobo (bobo) wrote: >>> To be honest, I don't remember what I meant by sibling calls. They >>> don't even leave anything on the stack. >>> >>> For noreturns, the code might be laid out like this: >>> >>> func1: >>> ... >>> call noreturn_foo >>> func2: >>> >>> func2 is immediately after the call to noreturn_foo. So the return >>> address on the stack will actually be 'func2'. We want to retrieve the >>> ORC data for the call instruction (inside func1), instead of the >>> instruction at the beginning of func2. >>> >>> I should probably update that comment. >> So, I want to ask is there any side effects if i modify like this ? this >> modification is based on >> >> your fix. It looks like ok with proper test. >> >> diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c >> index e9cc182aa97e..ecce5051e8fd 100644 >> --- a/arch/x86/kernel/unwind_orc.c >> +++ b/arch/x86/kernel/unwind_orc.c >> @@ -620,6 +620,7 @@ void __unwind_start(struct unwind_state *state, struct >> task_struct *task, >>                 state->sp = task->thread.sp; >>                 state->bp = READ_ONCE_NOCHECK(frame->bp); >>                 state->ip = READ_ONCE_NOCHECK(frame->ret_addr); >> +              state->signal = ((void *)state->ip == ret_from_fork); >>         } >> >> diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c >> index 7f969b2d240f..d7396431261a 100644 >> --- a/arch/x86/kernel/unwind_orc.c >> +++ b/arch/x86/kernel/unwind_orc.c >> @@ -540,7 +540,7 @@ bool unwind_next_frame(struct unwind_state *state) >>          state->sp = sp; >>          state->regs = NULL; >>          state->prev_regs = NULL; >> -        state->signal = ((void *)state->ip == ret_from_fork); >> +        state->signal = false; >>          break; > Yes that's correct. Hi, josh Could i ask when are you free to send the patch, all the tests are passed by. thanks for your help. Wang ShaoBo >