Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1508589rwd; Tue, 16 May 2023 19:12:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4nfdDABQ/8Mm8oa8942P9gAA3rGIY08MuE9W592MEItlQeH7QCOot8c8JDGSpn9A8fwm3F X-Received: by 2002:a17:90a:2a47:b0:253:3118:1ba0 with SMTP id d7-20020a17090a2a4700b0025331181ba0mr2762958pjg.11.1684289540700; Tue, 16 May 2023 19:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684289540; cv=none; d=google.com; s=arc-20160816; b=bDVlhQZILdLrtLYFQBDwXFrunKuB+KGK9wdT6h8Ue1PDSqf+1dtYsnAEOX/Np238li a0pUfCHSyP+x0au7VWXRBj4UrI1AF1+9HwC9aWhcS3ez1UZ95lk4VuRryTh3EJaIavx3 c5GglW3spfw1reIedIoQQYvhiRM9ob/+a2dFB32ZLsiuM489DW8PmggZfHjpFFDAXXRQ wnoaaM7RHD2xANAHXEnXWzhNJfCrgJSjxKQiEghObRRckrvciJpsUjH4oYQ5SKfLd7NT 2Bbt8qeynp83hv+Dj8ZS5/0epU8zGAJfOAcV1r67unKtKYRbxVEwq+12Xkc8AhvU3Xoi XjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=PzZh0bIZSJ+JPhYvLDEGW/XgH4+hk0vQUZAdjfNNsdg=; b=rikjVPz5uIgEx+H7ibtbdYBST2Nq8wcU/8MzfprjrUg5gkayY6YMW+cMCh6YZL6I63 ikvCTYpB4VeCyMhAb4SV8INU0/i41J58TvnvMFEpdrmT243QaMh7brcGNFS16eufpfWr X/UQvGQRek9+JD+70kyyUqLA4OsRdwjxPHpyHfpKOF/Jl+swWsfLyBmeCOupDZAJI9jg KUEkrEclbD7wDT6Ok8Tn7rlwXWdob+rtDwRxd/qbc0ak1N7zaJvS4SYjLoGBiOadgU6D H1peCyGGwqQx+5MFhHZOXA0lHR+4YHP7Z2k+epsY2mbwZOw5tUkSRu0vhaZjbWp+/PzX aTgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ZbE0g5qJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a639305000000b0051f74820afdsi20362415pge.782.2023.05.16.19.12.08; Tue, 16 May 2023 19:12:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ZbE0g5qJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231683AbjEQBzK (ORCPT + 99 others); Tue, 16 May 2023 21:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231177AbjEQBzH (ORCPT ); Tue, 16 May 2023 21:55:07 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36F4D3C33; Tue, 16 May 2023 18:55:06 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-51090206721so370982a12.0; Tue, 16 May 2023 18:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684288504; x=1686880504; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PzZh0bIZSJ+JPhYvLDEGW/XgH4+hk0vQUZAdjfNNsdg=; b=ZbE0g5qJQ2o9t0i1MOgKVdjGyHIxLEcWxeQfDxs9Z/f5sK1/cZh05zbTDuiM0wv3eT ifv1XJk4gYn/uZi7kgIM/IAxyph61Tn2TfJC2F78HRn5M/CORQJx+zPrpnDyhFaEyTDR LzSPODZYS8B+7Piwap7DrMRvMQAhcQq13pxT3TzPd2kQ8VxzzWAOi1GZSKN6HsO2GlT+ SURfW30bGy/IxQevnxxYtzfGiQXGQlofTtqcXMTIVTA9YKL4/PiNVhgqTtVcG1dh/Hpx Tp8rlIoSdBsO1ummd85QXj8qkuq0A/hhhdM9X31zqAz0nVvl7IUBn545twb9SIKOLo3D Uj/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684288504; x=1686880504; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PzZh0bIZSJ+JPhYvLDEGW/XgH4+hk0vQUZAdjfNNsdg=; b=ZGox+Cv2C6lTEZJHVDbC1L/w4BDecPcPN4a01RSj8aKwSvCeNpH+wdoZmC/KoNyKN8 UP09cBzQWYd/IFlzF14TpH4nQTn4TN037Pl/PJav8mvLEiS0tf3fYTjMPHyYxEVkd3D9 ePq0ObgrBBJ7KOUZaP7Qj80o4MQZJ4qgmR+/XjnbKG1sy0UJThHX5iOksu29g755az+I 0cSghaW4z2v3RDydx8M947Uw2w/dT2PAkKszo3pPF4GQnp0gwYmPC26WcjOqnFRw7wBM /90clwuWUh+nSgPNMh8hj8haz/m1QnRsqT1i4RBzdbKmXd5NXSejY+js2TfEzbfftkkh QhfQ== X-Gm-Message-State: AC+VfDxBhUsAURDFeE7brMwnq1GIieJ2rI1b6I6qpAifO1aYrNrYoC7g xTH/Pvyhw21BiNf1Q1UU49lyWgv/+XAsM0MbTwA= X-Received: by 2002:a50:fb9a:0:b0:506:9805:7b56 with SMTP id e26-20020a50fb9a000000b0050698057b56mr856882edq.32.1684288504486; Tue, 16 May 2023 18:55:04 -0700 (PDT) MIME-Version: 1.0 References: <20230516071830.8190-1-zegao@tencent.com> <20230516071830.8190-3-zegao@tencent.com> <20230516091820.GB2587705@hirez.programming.kicks-ass.net> <20230517010311.f46db3f78b11cf9d92193527@kernel.org> In-Reply-To: <20230517010311.f46db3f78b11cf9d92193527@kernel.org> From: Ze Gao Date: Wed, 17 May 2023 09:54:53 +0800 Message-ID: Subject: Re: [PATCH v2 2/4] fprobe: make fprobe_kprobe_handler recursion free To: Masami Hiramatsu Cc: Peter Zijlstra , Steven Rostedt , Albert Ou , Alexander Gordeev , Alexei Starovoitov , Borislav Petkov , Christian Borntraeger , Dave Hansen , Heiko Carstens , "H. Peter Anvin" , Ingo Molnar , Palmer Dabbelt , Paul Walmsley , Sven Schnelle , Thomas Gleixner , Vasily Gorbik , x86@kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, Conor Dooley , Jiri Olsa , Yonghong Song , Ze Gao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oops, I misunderstood your comments before. Yes, it's not necessary to do this reordering as regards to kprobe. Thanks for your review. I'll rebase onto the latest tree and send v3 ASAP. Regards, Ze On Wed, May 17, 2023 at 12:03=E2=80=AFAM Masami Hiramatsu wrote: > > On Tue, 16 May 2023 17:47:52 +0800 > Ze Gao wrote: > > > Precisely, these that are called within kprobe_busy_{begin, end}, > > which the previous patch does not resolve. > > Note that kprobe_busy_{begin,end} don't need to use notrace version > because kprobe itself prohibits probing on preempt_count_{add,sub}. > > Thank you, > > > I will refine the commit message to make it clear. > > > > FYI, details can checked out here: > > Link: https://lore.kernel.org/linux-trace-kernel/20230516132516.c90= 2edcf21028874a74fb868@kernel.org/ > > > > Regards, > > Ze > > > > On Tue, May 16, 2023 at 5:18=E2=80=AFPM Peter Zijlstra wrote: > > > > > > On Tue, May 16, 2023 at 03:18:28PM +0800, Ze Gao wrote: > > > > Current implementation calls kprobe related functions before doing > > > > ftrace recursion check in fprobe_kprobe_handler, which opens door > > > > to kernel crash due to stack recursion if preempt_count_{add, sub} > > > > is traceable. > > > > > > Which preempt_count*() are you referring to? The ones you just made > > > _notrace in the previous patch? > > > -- > Masami Hiramatsu (Google)