Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp988016pxb; Fri, 22 Jan 2021 04:34:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/pONRrLhkyGttxvD1SEN5amFumfjtIH04OfuQn1V8aGzIIGv0d2P1SvMcO7cTr3/hGOPe X-Received: by 2002:a17:906:1c17:: with SMTP id k23mr2744700ejg.255.1611318899356; Fri, 22 Jan 2021 04:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611318899; cv=none; d=google.com; s=arc-20160816; b=Gxv5Cx0mPr30Rz6QV5sT+NAAG/tG2HdM6P850wHENEG/NcL/wSHvkffBXQkQCGOfkQ i5lzsYykxApWU2q/3rsCQu0XlEnLCDJmNT5fygNJzr5WfbOpnmNrL3DbZpZ13c/gsY3s o6LMLmMIQlzlacp6wL4gSVV1FfCsVj88jPrVQ2m5jkz3T7mehaQKLHXYDWO6sNdmwCZG VWYXAJpDF6mflGHHWahHbsHvsrnng7ZJtZHpsqeulqSwh+g4S0SSHpvhHdftAJFgUbIn pOInRzotZuYQUG1bnnTecCS2oDAKWOe6sjIx+YWf5wn5GUDs5za9ViUCF1c/TLrzrei2 ox8Q== 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 :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=p0MF2XaKmOeb/u0HWCvklvMsnqWEvoVRz2S/+TPNxtw=; b=c0IsQmbvb2axGvNAdOHfe/QMCtM+rncB/pNAsDyJJlevPrO0nH2Wmwe1hMki0maasA XShLARSbFj1DF7ddOdE9aA3zIiMv/MG03E5YAQXx0YiopW+rdighTpUFbl/ZU/HxHBWh QPnrIXRytSMXujO5GhMV+JKs8sA3Jm6oqzb4RxnNvs/w40ob0JOo4+7KwWbr7QHbbG95 vAdzrJW5GEdAphGsly0PqCbDc7sqSKfh01Pc9WrJBi0LV2wGhLJpTiOVe9lUHF3LZo/t Aq+10hNuBqtxMcE1o98/DUKTUhaYhtyhbFf5+2XvtrgMhF3l/aC8Ex+qc1CHRBtb42FN VzxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch15si3323156edb.370.2021.01.22.04.34.35; Fri, 22 Jan 2021 04:34:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728025AbhAVMdq (ORCPT + 99 others); Fri, 22 Jan 2021 07:33:46 -0500 Received: from mga11.intel.com ([192.55.52.93]:31333 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727364AbhAVMcj (ORCPT ); Fri, 22 Jan 2021 07:32:39 -0500 IronPort-SDR: QRm3okV+xeqptNytfnW0wq+5GGwc8GsK9tX2IZ/mhYULb/K0lnN1o67zBxV4lfUfrVItKRVLuX U3no3Bj49qRw== X-IronPort-AV: E=McAfee;i="6000,8403,9871"; a="175927663" X-IronPort-AV: E=Sophos;i="5.79,366,1602572400"; d="scan'208";a="175927663" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 04:30:41 -0800 IronPort-SDR: uBVrSlQRMN/Wxt2zRSFR7E76RsH9hsyGA+ovXv0UiNK4th1b1gegW9JUEYhv/AfBua00CQUTnF wVcigEihKHzw== X-IronPort-AV: E=Sophos;i="5.79,366,1602572400"; d="scan'208";a="385741921" Received: from rbentoli-mobl1.ger.corp.intel.com (HELO outtakka.ger.corp.intel.com) ([10.251.187.124]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 04:30:12 -0800 From: Mikko Ylinen To: bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kpsingh@google.com, daniel@iogearbox.net Subject: [PATCH] bpf: Drop disabled LSM hooks from the sleepable set Date: Fri, 22 Jan 2021 14:30:03 +0200 Message-Id: <20210122123003.46125-1-mikko.ylinen@linux.intel.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Networking LSM hooks are conditionally enabled and when building the new sleepable BPF LSM hooks with the networking LSM hooks disabled, the following build error occurs: BTFIDS vmlinux FAILED unresolved symbol bpf_lsm_socket_socketpair To fix the error, conditionally add the networking LSM hooks to the sleepable set. Fixes: 423f16108c9d8 ("bpf: Augment the set of sleepable LSM hooks") Signed-off-by: Mikko Ylinen --- kernel/bpf/bpf_lsm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c index 70e5e0b6d69d..5041dd35f2a6 100644 --- a/kernel/bpf/bpf_lsm.c +++ b/kernel/bpf/bpf_lsm.c @@ -149,7 +149,11 @@ BTF_ID(func, bpf_lsm_file_ioctl) BTF_ID(func, bpf_lsm_file_lock) BTF_ID(func, bpf_lsm_file_open) BTF_ID(func, bpf_lsm_file_receive) + +#ifdef CONFIG_SECURITY_NETWORK BTF_ID(func, bpf_lsm_inet_conn_established) +#endif /* CONFIG_SECURITY_NETWORK */ + BTF_ID(func, bpf_lsm_inode_create) BTF_ID(func, bpf_lsm_inode_free_security) BTF_ID(func, bpf_lsm_inode_getattr) @@ -181,6 +185,8 @@ BTF_ID(func, bpf_lsm_sb_show_options) BTF_ID(func, bpf_lsm_sb_statfs) BTF_ID(func, bpf_lsm_sb_umount) BTF_ID(func, bpf_lsm_settime) + +#ifdef CONFIG_SECURITY_NETWORK BTF_ID(func, bpf_lsm_socket_accept) BTF_ID(func, bpf_lsm_socket_bind) BTF_ID(func, bpf_lsm_socket_connect) @@ -195,6 +201,8 @@ BTF_ID(func, bpf_lsm_socket_recvmsg) BTF_ID(func, bpf_lsm_socket_sendmsg) BTF_ID(func, bpf_lsm_socket_shutdown) BTF_ID(func, bpf_lsm_socket_socketpair) +#endif /* CONFIG_SECURITY_NETWORK */ + BTF_ID(func, bpf_lsm_syslog) BTF_ID(func, bpf_lsm_task_alloc) BTF_ID(func, bpf_lsm_task_getsecid) -- 2.17.1