Message ID | 20220328175033.2437312-2-roberto.sassu@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-fsdevel-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 062ECC43219 for <linux-fsdevel@archiver.kernel.org>; Mon, 28 Mar 2022 17:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244747AbiC1Rxw (ORCPT <rfc822;linux-fsdevel@archiver.kernel.org>); Mon, 28 Mar 2022 13:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244761AbiC1Rwx (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); Mon, 28 Mar 2022 13:52:53 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47B5159A5D; Mon, 28 Mar 2022 10:51:12 -0700 (PDT) Received: from fraeml714-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4KS0Z80VPMz67PnL; Tue, 29 Mar 2022 01:49:20 +0800 (CST) Received: from roberto-ThinkStation-P620.huawei.com (10.204.63.22) by fraeml714-chm.china.huawei.com (10.206.15.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 28 Mar 2022 19:51:09 +0200 From: Roberto Sassu <roberto.sassu@huawei.com> To: <corbet@lwn.net>, <viro@zeniv.linux.org.uk>, <ast@kernel.org>, <daniel@iogearbox.net>, <andrii@kernel.org>, <kpsingh@kernel.org>, <shuah@kernel.org>, <mcoquelin.stm32@gmail.com>, <alexandre.torgue@foss.st.com>, <zohar@linux.ibm.com> CC: <linux-doc@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>, <netdev@vger.kernel.org>, <bpf@vger.kernel.org>, <linux-kselftest@vger.kernel.org>, <linux-stm32@st-md-mailman.stormreply.com>, <linux-arm-kernel@lists.infradead.org>, <linux-integrity@vger.kernel.org>, <linux-security-module@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Roberto Sassu <roberto.sassu@huawei.com> Subject: [PATCH 01/18] bpf: Export bpf_link_inc() Date: Mon, 28 Mar 2022 19:50:16 +0200 Message-ID: <20220328175033.2437312-2-roberto.sassu@huawei.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220328175033.2437312-1-roberto.sassu@huawei.com> References: <20220328175033.2437312-1-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.204.63.22] X-ClientProxiedBy: lhreml754-chm.china.huawei.com (10.201.108.204) To fraeml714-chm.china.huawei.com (10.206.15.33) X-CFilter-Loop: Reflected Precedence: bulk List-ID: <linux-fsdevel.vger.kernel.org> X-Mailing-List: linux-fsdevel@vger.kernel.org |
Series |
bpf: Secure and authenticated preloading of eBPF programs
|
expand
|
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index cdaa1152436a..8ffe342545c3 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -2459,6 +2459,7 @@ void bpf_link_inc(struct bpf_link *link) { atomic64_inc(&link->refcnt); } +EXPORT_SYMBOL_GPL(bpf_link_inc); /* bpf_link_free is guaranteed to be called from process context */ static void bpf_link_free(struct bpf_link *link)
In the upcoming patches, populate_bpffs() will not have visibility anymore on the links and maps to be pinned (to avoid the limitation of the 'objs' fixed-size array), but the eBPF-program-specific preload method will directly do the pinning and increase/decrease the reference count. Since the preload method can be implemented in a kernel module, also bpf_link_inc(), before called by populate_bpffs(), should be exported. Thus, export bpf_link_inc(). Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com> --- kernel/bpf/syscall.c | 1 + 1 file changed, 1 insertion(+)