Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp395099rwd; Tue, 16 May 2023 02:33:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5KOO8QTLRbsz4hziXT2h2FhD/Ys9SXTmN3SFUt83d7HYNSrFPWkCmj5tXz9npp6V2bKLCt X-Received: by 2002:a17:90a:e645:b0:247:35f8:81d2 with SMTP id ep5-20020a17090ae64500b0024735f881d2mr36478841pjb.29.1684229603562; Tue, 16 May 2023 02:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684229603; cv=none; d=google.com; s=arc-20160816; b=nwXPJs+15npeu7UZlPEeypdPx3mP/BPimZSLX63s7Ilkem83LZ3a/LCR3LlnNevHJ1 7588KtWwGAdXRpXyjNb5dYP3rNesj5ymy7rTlYiD9ybdUEAqL4sEtaKd0ZhPhaObt7q7 h9kGzuoOrLIZz0JLrPS+yFaj7ERdkhWFxDakAM5CPWVBoc/KYqc5PB6zREtKv3rdoZkT /OHuksEZo+R2jGdladzJWWlFvPU+GiIWIDvdO5Pr0Qia3QUoH4TFu//qs6mNl9lY7JXw gKDsrFjmUv9IjWGx2fqXxM+5Udc6+X1lL8KUnE0pr+A7WPzRq3hnLHjCkLMu4tyfPM6m o5Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=T4Sl1ooBMpb0KanF1wJIqGZiESG+DyDGWDVl3K8WeZc=; b=V2g6B0bfeBUTs1elCQ36yd/sAdEaN09DcvzdK2SJbThEtKBnTc/NMmIeR3pT/kyZnS eo3fPlCwGk342koRrVRDfgb9ypQGPuFo27vb8W0X0pw0Z3c33ms5QwGwNgQ4PyLIxFff XQjERKROS0/WLOEYzIavMQdMDtBYZLWr1KPcPKk+aFj5EXIvfls4qZz3FvDIYh1IpkOK ig04IqrYKV6nWQ/nIN1CB2wEw6Z70tW5WTjCkEAl0KHIJETfcic4wdWG9nHoGK0PmHQo 0Z6OnM9w1zT2QWXKP9rARrX3c8hRp0MowyWocekewW6ZzhGYsYNeyDuuK2n5bD/Vh2qV jZFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=thpq6ZmH; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cv16-20020a17090afd1000b0024dec166f91si1396596pjb.98.2023.05.16.02.33.09; Tue, 16 May 2023 02:33:23 -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=@infradead.org header.s=casper.20170209 header.b=thpq6ZmH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231941AbjEPJTj (ORCPT + 99 others); Tue, 16 May 2023 05:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231978AbjEPJTb (ORCPT ); Tue, 16 May 2023 05:19:31 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF9C3588; Tue, 16 May 2023 02:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=T4Sl1ooBMpb0KanF1wJIqGZiESG+DyDGWDVl3K8WeZc=; b=thpq6ZmH4G9fdo7dFMIuaCShJn vKgsEXcb3N7S96cxM34TNZ0/2ZeXZ+/8JQ+/2rYIVRdvI3/0EAMO3H14GOFLlVQBmFluRR0qCrYtd sO9vJz5Ibq0vbeWMngbnNu/YT13I0sIvRpOcrHkDIzsB18UYTCFt7ZC03H2ly1MDx98Y76sbEgkAb +badUdO52UmI9I7EB4CdAY3MgGbok5FHWffCtRCGhWICUEeA4njesY3PqrW5UKvhU5b1FQ7Z2MAqK a1eW3FfI/q+76vBbtLDD6a8befQtUWBPfkxkUtPTLm9+pTABNLs8p5nxOeE+ruY1IWLV2YKdyrZtC vgDNLtaQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pyqp2-0048AC-U4; Tue, 16 May 2023 09:18:21 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7BE8330008D; Tue, 16 May 2023 11:18:20 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 60A632011856F; Tue, 16 May 2023 11:18:20 +0200 (CEST) Date: Tue, 16 May 2023 11:18:20 +0200 From: Peter Zijlstra To: Ze Gao 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 Subject: Re: [PATCH v2 2/4] fprobe: make fprobe_kprobe_handler recursion free Message-ID: <20230516091820.GB2587705@hirez.programming.kicks-ass.net> References: <20230516071830.8190-1-zegao@tencent.com> <20230516071830.8190-3-zegao@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230516071830.8190-3-zegao@tencent.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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?