Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6150917rwr; Mon, 24 Apr 2023 14:46:31 -0700 (PDT) X-Google-Smtp-Source: AKy350b76p16TpXOxwIPCF5lQLyPl+pzDYS2sqdc9GVE/IXyvFtzQENatpK+jD1bJwLB9Z8lUXdH X-Received: by 2002:a17:90a:4745:b0:247:3548:e470 with SMTP id y5-20020a17090a474500b002473548e470mr15783959pjg.29.1682372791362; Mon, 24 Apr 2023 14:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682372791; cv=none; d=google.com; s=arc-20160816; b=iz9CCO7hsdiJQMVUDxtwRlJ/26+2AWWApKWrc7bqkvz0yxvIAVPS1cfN0PXVc3Ynac MsI+BO+wqI+QS1chTLug3f7j3aZRTQwHHcd1L76Jsuc/GQbIWwtDXLwtvPhNiAFhlSmu qangh9DPizyoAE4ex53EbPrGdgZ94tBAuft+jdavWIYzNu9Xqe5a0K+HSBsp8W2P7nKG pTjgeXbG07esYsAN6uCYGxQpAGrVu0ug2JTQtxi17NGkzlTbFLM78P1KGECyktGbTU1o p/Pjz62nGESYKftHhW3KDzFjwADsovZeXPD7sn389hh3CiuaK540Dboc9S991VzlP1ji 5i9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=0BRQkPkMxZlzeC34ITNyj/izwJbsvw/Z0ifKSDk1txo=; b=d1+m+Ri0Jo/A7Gxmv9SBrNk3Z5JPWbDtVs3fvEfM9kHAkHFlhKjfGdv9QNhXHFHs64 AZ9k1pW2aoT9vNLMIawr8DW5DjQpvvk20iCJZj8NPu4y4vLnh9iWPDdkkP1za/Y1TX+T FZuiN4h4R1vqz7VjBzH9yWvxvfREkfzJq/xyD2K63qqvjSY5NEreFNrdhSKiIKsQeiQW Un1O3zbtve1LQQmgKyZY2Q6VqZArlFYIDD4wXyyovx0CDKbGaG1ARt270663Pz9gDrz2 MiczX0hqTG2vUsRKQdS4IzocBeDzbmI0On+LN0dpDbHShFQpS/8wVSH+xDJf1UJzWdEU q0Tg== ARC-Authentication-Results: i=1; mx.google.com; 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 l6-20020a17090ab70600b00235dc16de3asi14146024pjr.16.2023.04.24.14.45.57; Mon, 24 Apr 2023 14:46:31 -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; 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 S232658AbjDXVkz (ORCPT + 99 others); Mon, 24 Apr 2023 17:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbjDXVky (ORCPT ); Mon, 24 Apr 2023 17:40:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A8714C02; Mon, 24 Apr 2023 14:40:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A9DD062744; Mon, 24 Apr 2023 21:40:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEDEBC433D2; Mon, 24 Apr 2023 21:40:50 +0000 (UTC) Date: Mon, 24 Apr 2023 17:40:49 -0400 From: Steven Rostedt To: Alexei Starovoitov Cc: Yafang Shao , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Masami Hiramatsu , bpf , linux-trace-kernel@vger.kernel.org, LKML Subject: Re: [PATCH bpf-next 5/6] bpf: Improve tracing recursion prevention mechanism Message-ID: <20230424174049.1c9e54dd@rorschach.local.home> In-Reply-To: References: <20230417154737.12740-1-laoar.shao@gmail.com> <20230417154737.12740-6-laoar.shao@gmail.com> <20230417201457.c43xfcukjzm4u6vx@dhcp-172-26-102-232.dhcp.thefacebook.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 On Wed, 19 Apr 2023 15:46:34 -0700 Alexei Starovoitov wrote: > No. Just one prog at entry into any of the kernel functions > and another prog at entry of funcs that 1st bpf prog called indirectly. > Like one prog is tracing networking events while another > is focusing on mm. They should not conflict. You mean that you have: function start: __bpf_prog_enter_recur() bpf_program1() __bpf_prog_enter_recur() bpf_program2(); __bpf_prog_exit_recur() __bpf_prog_exit_recur() rest of function That is, a bpf program can be called within another bpf pogram between the prog_enter and prog_exit(), that is in the same context (normal, softirq, irq, etc)? The protection is on the trampoline where the bpf program is called. Not sure how ftrace can stop BPF or BPF stop ftrace, unless bpf is tracing a ftrace callback, or ftrace is tracing a bpf function. -- Steve