Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp428325rwd; Tue, 16 May 2023 03:07:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74VkGP/DPsQhgNYayS/p1C3MwBAXF04Bsove6JI17vc2rGIXfK/tocLZ2x2Uiet93G+uiz X-Received: by 2002:a17:902:778c:b0:1a6:3ffb:8997 with SMTP id o12-20020a170902778c00b001a63ffb8997mr1740257pll.42.1684231625753; Tue, 16 May 2023 03:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684231625; cv=none; d=google.com; s=arc-20160816; b=h5YUNH33CxjVuPl1sMHUlecc7ew5U6ieS1891dGNDYt+UUeF+br0t9ZNlvB1oVsgJb odfQ1r7bPESczY8S6duViehM1cqFM0/4aQcOeRutkj7XiE47d76jbl9hIcopgkI1oxFF DJHJN/sf0DGqu1vSiGoOY8q/NcmkIrSIIEMtt/zqfQc+7GsCOZVkKnRF+zKxk7EYX5rD yGB+F5/6s9USrpLkSXxauya0hBI3M3Hr3CCirIH172283a+mPMltRQYn7ANVObDzL1Xk n/6eyI44fv9tgJqSSlWENeFEfsw1N5CEzDq5EyDGFJRGjQBeY3BqdkqGCwmyhm94XP9T qlUA== 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=bvja6u6ZFGfnkLgz3Y8JuncRIU7gT8PI/VykX029Ek8=; b=v3wJAHcSSy0nC4E+BgFRIqQ9PWLxb76rAlUg7Q2fE2GQwYt8nLgs3YuJrDQhmU8biK gEWGSYnaJuet1JfUocYwcUq/JjEfzzMkt/Ooilwj88mSnyQD2jOre022Bfmn21jD6ivl nW+/2JzJHnq6nPXktRUvnOhxG9Z2IWLx7uacWe74SlB3QxEI9K42lEpcQEpoKhtNvBaO CPdxqu8ADxsatXFJtT/va746BZklxHkqr+MC3aJTQ6euoeo+WGFglzugS2oUN4kWVNxz bmhesrZqY/YIGI5WtDdn11aAE0eMjAsaQgz/In1s4ih5D+anAPsMEfs1Nqy8a22f1fZK OtXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="TC7kZ/eT"; 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 d6-20020a170903230600b001a1eac2df75si19986129plh.490.2023.05.16.03.06.53; Tue, 16 May 2023 03:07:05 -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="TC7kZ/eT"; 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 S231888AbjEPJsO (ORCPT + 99 others); Tue, 16 May 2023 05:48:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231921AbjEPJsJ (ORCPT ); Tue, 16 May 2023 05:48:09 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD1752D62; Tue, 16 May 2023 02:48:05 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-50bc570b4a3so24971550a12.1; Tue, 16 May 2023 02:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684230484; x=1686822484; 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=bvja6u6ZFGfnkLgz3Y8JuncRIU7gT8PI/VykX029Ek8=; b=TC7kZ/eTedXqDpQDxFKtRdYmJcctfLX6NTMRBtAufhESfjfZFEbqTOwHLyakOCtvW0 AMBh812gNA/G0aj8rpTd6aE2NMZwOWYIQ+dEhHCfRIT7f+UR/e+BwhnodvdfqbO+wb6U eRsVzFQ9r9dSTvVsd8slJf/AXpUgm3neL8HFRbZ6TvzwrSj9eaa80Kd5Ae0mH3g38KWb 0rxQElUd98LPtTocedpBmQtSgxVDb+DXoUfIwerj3++n+SHfyWBHYYoVGZYZH8cc1Rp/ iCPK5pJKUn4uSOhWWDOrnur3lpeS2sVYd3XMEmKfCashfPiPR9u8n5okyWqkkRdaFWdM /zpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684230484; x=1686822484; 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=bvja6u6ZFGfnkLgz3Y8JuncRIU7gT8PI/VykX029Ek8=; b=hc1+fk5sUeJputphOQr8sq4JyNowBSk4JxBVKqUYZHtuaRmD2ZdFRm1hf7rsB9wAY5 N06vP12tIKBvUkRXoE4Pm/8vUIA70wm/Vwzz1+Qm7O1i4oj2QSU1ksUpZDDyAcWaI9A1 58wKKrxS9N5aNjPM16lPgWt0ykng/42sF2HTaD5GfSdIc3qUX5/Cmxv4vMF9O+pbNTq+ QcZWUAH8Jn7k46s8At7wqpT3MFFRb+PtF9T5wFQTHe23VFn7bxDdGXTvdCP0jqTrNIOE Lpypp0d3uXiG3oI8ukYCt+KLmhaiSPb+M0wroyK1B/Br+k4XYlmQ1oJNTYCew2vWmOFl 1t7A== X-Gm-Message-State: AC+VfDyAaEnDkaYc3cCo2w+cLpHyOzPH11723jnGw22viL3gc9c7NS+c gCVHw9IAcbk+KSf6DXcqM7V7V8/UVNIsCqtzD/I= X-Received: by 2002:aa7:d943:0:b0:510:47a3:e775 with SMTP id l3-20020aa7d943000000b0051047a3e775mr6274132eds.41.1684230483965; Tue, 16 May 2023 02:48:03 -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> In-Reply-To: <20230516091820.GB2587705@hirez.programming.kicks-ass.net> From: Ze Gao Date: Tue, 16 May 2023 17:47:52 +0800 Message-ID: Subject: Re: [PATCH v2 2/4] fprobe: make fprobe_kprobe_handler recursion free To: Peter Zijlstra Cc: Steven Rostedt , Masami Hiramatsu , 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 Precisely, these that are called within kprobe_busy_{begin, end}, which the previous patch does not resolve. 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.c902edc= f21028874a74fb868@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?