Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3356994ybi; Tue, 2 Jul 2019 06:30:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJCK3tnWPEANXhnRTwCcHzEVB3ATyQbu0EbrFW3sRDU436egOCc3dlyFrGO4+PQHnCSeIq X-Received: by 2002:a17:902:e281:: with SMTP id cf1mr34253948plb.271.1562074206737; Tue, 02 Jul 2019 06:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562074206; cv=none; d=google.com; s=arc-20160816; b=mAnHK+8hjQiBjHfTgxpbiMrmf/SB4mEcqboJdeKJdF+EfzS/5chDghzf+WVao2OwlQ rkZ1BXRBtwRnI+0i7xXhgXCJ3gtJ1yQPRiHgNTxsLd+toe8zvSZ+FTmoTKyZD44w4O4H PhWSn/UvyORQlQr1XMRFK7B8kKaiY4Gjri33UgtX2ElBLG+QyyKN70MxW7r3Lr0nSDRk D7b2ogTDHLuXRMEUoPkbHNcN6aOnLP8y4Pt4vvllhW59TwSRLPf7TJpS31oxjXwg2aj+ wE2pOzPKJ3bQq9TcwhcU8/wrfyiPqQ0rGOR3y2jzI4DrBEBJdSa63Ui35thlPUVaxRC1 hrhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=5W1XnI87EdN+iEZnJ7HJrv4JlkIHvBzIZs+5vrzluXU=; b=d2sdhqS1a80KyVYHt+e0ZaxKSbsZdm9P+1o8GYA91pgRJCqbf7yaPh4tCXzfQyqtbP gXhPYFcc7S/yuqE5/jKYSivOmJ69pJY9tJkfX2Od8MRIlQR1GnJtDUXNRJxfZYLY/zAk Y1lMv9lgPU6zB9AGth9i7FnpWOV5cMD8n/qtrwkmDrKgBd3IjF+8IgLuFxz2yPSeSjCe TS7nDpHacowjrZRv/M0q6y+zNrZQ7Q5PGHUWzwvfL8SyWyUhD40x+Xm5xGDBDVEg3zKd Kg6R3RbUzVeHZO3MIfW5L/lMuV+doEL1HG0aC8kvzUsH7FXHndl6S3QPwk0+3D4q/EID Z7Gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si2211029pji.109.2019.07.02.06.29.51; Tue, 02 Jul 2019 06:30:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726966AbfGBN3a (ORCPT + 99 others); Tue, 2 Jul 2019 09:29:30 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:43714 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725922AbfGBN3a (ORCPT ); Tue, 2 Jul 2019 09:29:30 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id AEDEFF87C39AEE16812D; Tue, 2 Jul 2019 21:29:25 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Tue, 2 Jul 2019 21:29:17 +0800 From: YueHaibing To: , , , , , CC: , , , YueHaibing Subject: [PATCH bpf-next] bpf: cgroup: Fix build error without CONFIG_NET Date: Tue, 2 Jul 2019 21:29:13 +0800 Message-ID: <20190702132913.26060-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_NET is not set, gcc building fails: kernel/bpf/cgroup.o: In function `cg_sockopt_func_proto': cgroup.c:(.text+0x237e): undefined reference to `bpf_sk_storage_get_proto' cgroup.c:(.text+0x2394): undefined reference to `bpf_sk_storage_delete_proto' kernel/bpf/cgroup.o: In function `__cgroup_bpf_run_filter_getsockopt': (.text+0x2a1f): undefined reference to `lock_sock_nested' (.text+0x2ca2): undefined reference to `release_sock' kernel/bpf/cgroup.o: In function `__cgroup_bpf_run_filter_setsockopt': (.text+0x3006): undefined reference to `lock_sock_nested' (.text+0x32bb): undefined reference to `release_sock' Add CONFIG_NET dependency to fix this. Reported-by: Hulk Robot Fixes: 0d01da6afc54 ("bpf: implement getsockopt and setsockopt hooks") Signed-off-by: YueHaibing --- init/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/init/Kconfig b/init/Kconfig index e2e51b5..341cf2a 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -998,6 +998,7 @@ config CGROUP_PERF config CGROUP_BPF bool "Support for eBPF programs attached to cgroups" depends on BPF_SYSCALL + depends on NET select SOCK_CGROUP_DATA help Allow attaching eBPF programs to a cgroup using the bpf(2) -- 2.7.4