Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4166898rwe; Mon, 17 Apr 2023 08:50:56 -0700 (PDT) X-Google-Smtp-Source: AKy350a4EM2HP9sT5+Rrx6Rfqzo8eZw5aJZJNWrwMK4jTdBUQ8RcSxRYlJLtynQVQ027GPyvkpMp X-Received: by 2002:a05:6a00:1794:b0:63b:877f:ee53 with SMTP id s20-20020a056a00179400b0063b877fee53mr9431165pfg.17.1681746656565; Mon, 17 Apr 2023 08:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681746656; cv=none; d=google.com; s=arc-20160816; b=j0od9s/N6BSR02PVmByxa3LT/YNPLpvVKKRmJYXLf9dlEgzMwNfeuWpXI8OyKtD4Eo C8Hx7BWX8xZwGa5r5s8HyFk/dCubNJtBWDPblaRmtlpPE0IrNPBhp18w0sXtzRiA48dq 7BXLMZnFphRjfMr/iaPdwtnTOAVEkMQWjFcmzfhWoWqcrzauWIVIGMDbOh45S2MvyfKT 8uTd+WnflEfIBkkEsAAGvSrY9lIo9OBV2k11ZKpcyRxdyRYLoGRV6w7Fpm8FCHFIPxaI LLxlUDF4S7VXO9OxXYLN4ILXtoRwIA/dhgeqXa3RSBVi3E8llK0CwBhEuxi72f9uMZIJ xPyg== 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:date:subject:cc:to:from :dkim-signature; bh=hzwNPovO934/64aRBZe++yk+dNmk1JTc3kyHlCW2thM=; b=ULB56neXZo7edcVoqaOvtxxoby/mmMe9PVkgt0IQV5nMUxrhuDw16JryqS+boHDWdS qqsG8dCeWZUk3sfP2pXSuzs59ICwqVIYUiBt5p0Z/p7Col/uAOQB3M2RX3557CPNzUK0 gJ1syFbFAhICMVfgB3OTxSGoMlJ4Qf0GGUmYWzxwWvznIev6OTUFCn62dqg51Mwyak3W KAZRNMUNTFjnP5MoBAFPUrsOLCNRYp2VmRYuWhAU2hE3mc9FkXnmkgP24pB88QZl4m3X iKlBq+MajgzRnX+xVBXE0o4kVnBK0kEsRCQzk4rr3T4fM5DhhgCsxWY3qw0fTt4PXAWp fgkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=EtvJ8wzz; 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 d66-20020a621d45000000b0062794514e85si11686856pfd.376.2023.04.17.08.50.42; Mon, 17 Apr 2023 08:50:56 -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=EtvJ8wzz; 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 S231469AbjDQPtE (ORCPT + 99 others); Mon, 17 Apr 2023 11:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbjDQPsp (ORCPT ); Mon, 17 Apr 2023 11:48:45 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C753CC09; Mon, 17 Apr 2023 08:48:19 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id o2so26125750plg.4; Mon, 17 Apr 2023 08:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681746498; x=1684338498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hzwNPovO934/64aRBZe++yk+dNmk1JTc3kyHlCW2thM=; b=EtvJ8wzzGeIKNvCSRVQyBRs0///s9z59xSvbgIBRPTP1pfha9sUxogoFUVO0c0db+g M0COUsSWzkRLMZ+BDmNpjNjihYBldeUy7CY+ea/XG6e5FC5qNvtB+ZpwGFQXDIXu8NmX 64xY4XB80LHkLvy+SfsRjM+m/8d1gweexpJpB3NblaNolg9oxMkQfNwiF+8FvZ8JM2zW HDzq/NK8MLfgTR9LMciv9ceCAK9TtdmoA4kd/QYe1ZddwdaGqEjucKQNjx8tgVFk6+DH mHGoEyEqZrq9qahzLy0G/E8FMAHx6sLdPtSlzL4L4nx8V2W6JapPUI1wGfB4yMUNmmHB XrYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681746498; x=1684338498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hzwNPovO934/64aRBZe++yk+dNmk1JTc3kyHlCW2thM=; b=fzEs6b4m7P0M3A8Qfym+mkaSXOol0fiXFsSzY8rWOdvI7T6C7HJnWy6QDAf1gaxnNx /GpRfbTS7QIX2STu8Szb1YBn5NXzwZSavVLxNHimwbVnwi+S1/0zQw8UwByXoQFgsfoj f5Xo3c78+3H0HufoEmUIt6To9HGk4JGT2C5/KItcxkmTbr/kk7BwLfEcpK2aUfbW85uA Ph7HaNRmodLNlPHXJHse4UE+Hkhc3APC/tbIBrUsQaGfLCw9V8HHGlCJA5KEBTIw93Ag oaa3Dk1+VUWQULC8PCRN5qcmzvU8xJULtHAXQxAheEqaJxRGHM/D36nSHySzVskwZfpz pc+A== X-Gm-Message-State: AAQBX9fuEF4wEvFvB/ovbpfLu08RuOPTtD97KuCZ1hoBDwqZp+8ZGIlO acWMsaaI6tjTqyknuqeBA10= X-Received: by 2002:a17:902:eac2:b0:1a1:b440:3773 with SMTP id p2-20020a170902eac200b001a1b4403773mr12088320pld.27.1681746497891; Mon, 17 Apr 2023 08:48:17 -0700 (PDT) Received: from vultr.guest ([2401:c080:3800:263c:5400:4ff:fe66:d27f]) by smtp.gmail.com with ESMTPSA id jj17-20020a170903049100b001a6b308fcaesm4437513plb.153.2023.04.17.08.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 08:48:17 -0700 (PDT) From: Yafang Shao To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, rostedt@goodmis.org, mhiramat@kernel.org Cc: bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH bpf-next 6/6] bpf: Remove some denied functions from the btf id deny list Date: Mon, 17 Apr 2023 15:47:37 +0000 Message-Id: <20230417154737.12740-7-laoar.shao@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230417154737.12740-1-laoar.shao@gmail.com> References: <20230417154737.12740-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 With the generic tracing recursion prevention mechanism applied, it is safe to trace migrate_{disable,enable} and preempt_count_{sub,add}. So we can remove them from the deny list. However we can't remove rcu_read_unlock_strict and __rcu_read_{lock,unlock}, because they are used in rcu_read_unlock() or rcu_read_lock(). Signed-off-by: Yafang Shao --- kernel/bpf/verifier.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 83fb94f..40f6b2c 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -18634,17 +18634,9 @@ int bpf_check_attach_target(struct bpf_verifier_log *log, BTF_SET_START(btf_id_deny) BTF_ID_UNUSED -#ifdef CONFIG_SMP -BTF_ID(func, migrate_disable) -BTF_ID(func, migrate_enable) -#endif #if !defined CONFIG_PREEMPT_RCU && !defined CONFIG_TINY_RCU BTF_ID(func, rcu_read_unlock_strict) #endif -#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_TRACE_PREEMPT_TOGGLE) -BTF_ID(func, preempt_count_add) -BTF_ID(func, preempt_count_sub) -#endif #ifdef CONFIG_PREEMPT_RCU BTF_ID(func, __rcu_read_lock) BTF_ID(func, __rcu_read_unlock) -- 1.8.3.1