From patchwork Thu Nov 2 11:05:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 117772 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp1915720edm; Thu, 2 Nov 2017 04:06:32 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SNk6uc0dBCbmdekm4Z/A4Dk0dqnqW43QQeS/mRjGyPn8q9OEYMEbicsNZKEs72ZS5jw10y X-Received: by 10.159.249.75 with SMTP id h11mr2874150pls.192.1509620792665; Thu, 02 Nov 2017 04:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509620792; cv=none; d=google.com; s=arc-20160816; b=mfrLuGjPsm7gDEnnYsdbRZYZgZpLAcnU9/RQkEIsZSsyJD3Mv0RwyRHSNZf7gpFvtB t1dN/sNgtxuS6P6zg5ek7kJ6LEDQY/SJ2gxwSlkQe/3j1LpzxpCqjqxBpAkD0lJ+mfL4 C3GCxQi73rMFLp0BhbNLJN9bcYHxVdF1TMEu8UpecH8MyN9tz5w90Wn3wdir9BdR6yKJ bbtBXJGP2/L4Vk2hgLopEKhsxfQsvWox0Fa/aWQd735qAF2xX0KySUUw0yeLN0tU7O0m aDpJyyRy72MFlwz31OAALWG4hSSJznLnrbwmDB4qorwsAjLp8CRY8GTpPsucSL+PQhK0 TMFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=B04vbwMRR5sCWdD9OfG1V/XJtb+Rkn2VnLMarZHq0eE=; b=YNGgLWWaY3QhCEEdot/sjv3RuOLC/sMg0cADGiBVppwbzLlB2EzayCH3syz1SLRWLz CLkyzyhPOZHvJDAB7Asv1rNsrSZ3GBhvzuT5WenivECllJjnQZhehHIS6aEF4h+/6dCI FOy2ZB2W1ErePG9SYdeG3ZXtCTxIg3Pj/qbfhKjYvdl88eZQPU2XntdIOR3Y1kLjptlA lN8xAZ8/emi8SpaTV2XsmxCmqwAM78GdWHcr8LCGX2JPlnuhP9jZ4LbKzQxRVo8FLNE2 +lVhY/Y5zWNnpefk9yczqvcb2bupcBgGh6msyoSZ9Ff7cCYM8jqCdqzNdvTn28sEepxz jDcA== 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 h4si3581661pfa.387.2017.11.02.04.06.32; Thu, 02 Nov 2017 04:06:32 -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 S933242AbdKBLGa (ORCPT + 26 others); Thu, 2 Nov 2017 07:06:30 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:51770 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752632AbdKBLG1 (ORCPT ); Thu, 2 Nov 2017 07:06:27 -0400 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lwzvt-1d41qK1HiL-016gXn; Thu, 02 Nov 2017 12:06:01 +0100 From: Arnd Bergmann To: Alexei Starovoitov , Daniel Borkmann Cc: Arnd Bergmann , "David S. Miller" , Edward Cree , John Fastabend , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] [net-next] bpf: fix link error without CONFIG_NET Date: Thu, 2 Nov 2017 12:05:51 +0100 Message-Id: <20171102110558.2746221-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:LqVptb8mfNHnHSUWVjKT2KrRKfAMuyN7V8a7qB+kYkv4nHuE0LR 56hXvbEuoxCkoyjRKTcYg/qxkTaZvMuLKqxrIGMSjJwsuOIF9XYaaVtD+hxQVCo7UxnQ0Hf lnhcEMJRDPMS6MlilCQbLfmdILQQBBVTHZdfOixR5RT22O2x15cC0ilhLrq03T+/GBwlEh7 QF1ME0anoQuKFbIuuxCXg== X-UI-Out-Filterresults: notjunk:1; V01:K0:bdOpqUL8dfo=:Grrvx/VPwkYGrmN4Wi2urX q+cj+yAODfolR4tzMI0QUeFyFdNsyiRTlVsc0462jVRvm4eaY3R7a02DZxeTJHNhqXcZRGd3Z rTdsf/tOBmLBqc34xj72gE2M0kRDRZGVhJjQNoliI9038aJDNpqOkNeLevJBs1mFYqfO76A04 6xSCWTa/Y6DsGnZR3N/z7LXbpM/hSkOURsD/9bMj78a1bAOg9WwPMX8JLlJKvTNM9ltlUFwOx rO6gaQJ0BkWp/5b7frxYfrLO42UUNSPY4dS8QTPEoPxY1oQxcNYunQzDNFFUDDjnYAWip5mWy 9IDtMjzFf0Bz+Kejy0mo0Uw5haoRb5medBeCo8+wDZNCXUoUhnPZZDDt/ZweU6ysIqTI/SFLI KpF5cIMeR/sLnfjIUDkPU8ffagsJCEM5ctbP9qWLwYNUsJnTMAUz3A0CyUtSlCb49BQoKl3B6 OhtwIJEn/RBxNffzjBDS8Pmj93HSbye6iEqHULFK+xQ8RMkUYCIQYju8AUPm9igstAuqowusT JxvCOvsUp871rc9TtuolOmxL/90giTOxZ4ejA6Yuox2kRBt8mF/WH1dTJWKPtCYhqTXTvPA7X UJbSrgrPv7f5TYL9Q2FrmDhWqFCQNimgHFABRIre3/tvNTdI4xXUpEFBNEB7w2Bfe8wTocG9g aTcSjwtPMNbtYmmiZUD8TRu8yWEq+h7nW1eHvQJB7dj2N+AmhXO44mdBrJLcJzR8kpdo4iJOf Mw/ZNjrXduaVnjP+oHqh2sFm+jOxt+fVukjolA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I ran into this link error with the latest net-next plus linux-next trees when networking is disabled: kernel/bpf/verifier.o:(.rodata+0x2958): undefined reference to `tc_cls_act_analyzer_ops' kernel/bpf/verifier.o:(.rodata+0x2970): undefined reference to `xdp_analyzer_ops' It seems that the code was written to deal with varying contents of the arrray, but the actual #ifdef was missing. Both tc_cls_act_analyzer_ops and xdp_analyzer_ops are defined in the core networking code, so adding a check for CONFIG_NET seems appropriate here, and I've verified this with many randconfig builds Fixes: 4f9218aaf8a4 ("bpf: move knowledge about post-translation offsets out of verifier") Signed-off-by: Arnd Bergmann --- Since there hasn't been a linux-next release in two weeks, I'm not entirely sure this is still needed, but from looking of the net-next contents it seems it is. I did not check any other trees that might have a fix already. --- kernel/bpf/verifier.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 Acked-by: Alexei Starovoitov Acked-by: Daniel Borkmann diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 2bb6d6aa7085..750aff880ecb 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -4561,8 +4561,10 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr) } static const struct bpf_verifier_ops * const bpf_analyzer_ops[] = { +#ifdef CONFIG_NET [BPF_PROG_TYPE_XDP] = &xdp_analyzer_ops, [BPF_PROG_TYPE_SCHED_CLS] = &tc_cls_act_analyzer_ops, +#endif }; int bpf_analyzer(struct bpf_prog *prog, const struct bpf_ext_analyzer_ops *ops,