Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp427871rwd; Tue, 16 May 2023 03:06:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IYRXP2QCEPk6O42Ng6b8H5Xhd4w+ZfYAzHNlGmtMUy6quj0CI0NCXOwFql428hUxl4ab6 X-Received: by 2002:a17:90a:ad6:b0:24e:807:bd09 with SMTP id r22-20020a17090a0ad600b0024e0807bd09mr37168343pje.1.1684231600476; Tue, 16 May 2023 03:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684231600; cv=none; d=google.com; s=arc-20160816; b=wzVNivu9YixotH/HkcQ9SQZivQ5UE/c6NzF0CM6mFK/+PatXSI2f6Ba4bsk59MiT5G bz6KclHz7+a0CJAQ2ExymY6nxrY+VdEQ06LUipWh89llr4qo2uIL44o7fvJm6dQk8o6Q vC78dsXRnRXnNbC8W1AL2e4gA/aZJ8nCnaipvmwttls89g7qe+sj/NKVbqSeBdNdTaDi IIykh7FWIO0rqrbj8eguyoGyG6CzLNZmUZsFyWef38Hb0iZ2/dyOP+TjtzEl62JEryq1 oFRmHumw2Ljq1dP4bKvRaxZafcF/sxNXodb0h6YjiDk8b72fsA3VrQ8Ia6sbYrqs7zWA 8nLA== 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=UGRnr0pf14CHov8UGeE0opuOVSemy26gQSSgqCQ8OBg=; b=ttLRigY5IbbER0lHxPwMzFAlaNNIeOTp/K8J5QRiBKo46+2j+0frsz3Qzq2h0OU4O7 h1VUHgS5+9vsJPwwqr98G5xm5tEd5U+nDaKmq9rgLdAJ+K3kDxp5HY6ssbwsMKrl1TBw dggE6HeSLmzYMWaSa4qbF0BPbLLunpFA0YUqNG9uC6yXr0a7fjRna1IoPlC/sc1fvEh/ IieuNq+3e7ZhsFoDMmZs8i/kGfV8DxydTjRou6uoeQR6FR6VrlKqYPLbqpsykHj6Vg5Q 6ACx32LEFv6zflkqZGiwL1x+qzESvIjbqpWKecGvsTyvVMfFjkdiwkMGrW5PZMm03rqi fv5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=TyARuFre; 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 mi17-20020a17090b4b5100b002528393e899si1453266pjb.164.2023.05.16.03.06.24; Tue, 16 May 2023 03:06:40 -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=TyARuFre; 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 S232176AbjEPJvz (ORCPT + 99 others); Tue, 16 May 2023 05:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbjEPJvx (ORCPT ); Tue, 16 May 2023 05:51:53 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 958891FEC; Tue, 16 May 2023 02:51:47 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-50bc2feb320so21212147a12.3; Tue, 16 May 2023 02:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684230706; x=1686822706; 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=UGRnr0pf14CHov8UGeE0opuOVSemy26gQSSgqCQ8OBg=; b=TyARuFrePmLKzB8Y4APhEC1j3pOxio/NqSOHioZ3lmLXGK4vgLurB9WR8Xw8wEjvuO /yfg1Da7tiI8dzFEUflqoVQzHmxBBnpuU71cWAw50ixw7Ka9TRejd+rX7vG2S8Ne48r8 f6V9/YrBojQxHWio238iQe75dZ7bcWtO3IaVZ/5wDp3yAOdqaQmnJ/2ySO3Mq2qUVvQd sOJNoY85jjHhy8Sw0/IFm+REkH+A+srv4nBaS6drUg95ae6FuXM8X11uuk9yj2B4Sc3d zdhE+SFulVdAWHIKroDxhu/T9R6ja8UPKEziJmYYS0WRcA9mExznmwHyM0kf+vRWl9LQ 4FpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684230706; x=1686822706; 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=UGRnr0pf14CHov8UGeE0opuOVSemy26gQSSgqCQ8OBg=; b=kIZmlY8kMDJ0LUfG2AvAztI6zBG8cRTa5pldp2q7I98Lf8K7PFKk+61vt5QMas1kst qmZGNy8dzVavSCw48wfykvy8Q0y/hjVqD+CYCtcMppds7l4NPJo8fkKFJed3wASioxHn NEiThRh7uaDNvlm8pxwKe/MZylR18k4eo8i2tGcwqOGKf2lAtBljVta02jbt7Z+h8GK7 KM4RMv+BzKPU57q4dTR33mhUwp+VlEH8BE+OqPxMkZ5n/8Pen4Jc5pzfJoGC6A1LzruT 73CzXRcHyoiezmI2zstWw9uAVCugjyXJr7c43BebaYLdRjKuic4IPDRcSoHt574Su1XW nDCg== X-Gm-Message-State: AC+VfDwcRNIoSUAgFZRygGidtDTIRrpcPnUhw1ZuA76G5bB3OZoSD0VP QsF4xV649h/77Pt0nVJPrYnYOhNV8VXbOyOnrMc= X-Received: by 2002:a05:6402:482:b0:50c:52d:7197 with SMTP id k2-20020a056402048200b0050c052d7197mr25360576edv.2.1684230705817; Tue, 16 May 2023 02:51:45 -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: From: Ze Gao Date: Tue, 16 May 2023 17:51:34 +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 Sorry for paste the wrong link, it's this one instead: Link: https://lore.kernel.org/bpf/20230513001757.75ae0d1b@rorschach.local= .home/ It's the original discussions of this problem. Regards, Ze On Tue, May 16, 2023 at 5:47=E2=80=AFPM Ze Gao wrote: > > 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.c902e= dcf21028874a74fb868@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?