Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp71841pxu; Tue, 6 Oct 2020 19:17:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydhAKst0WYVBPCWIej7n1YNBFLB/B6rWTsMHnMjU25nK+NfiCCoWAaTfet+uA3ES8UjpV5 X-Received: by 2002:a17:906:1e10:: with SMTP id g16mr1077840ejj.438.1602037064763; Tue, 06 Oct 2020 19:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602037064; cv=none; d=google.com; s=arc-20160816; b=afhtL/QEDO7Htxqnkjkyrd2Q4aYR7Kw80wefYpyXZmROwhvg4UGePqqCcB52Zo0MX4 mvuDpNKyUjkissKLwLVQbQKVAFgnOq6p5sKx721gTvcTgXVJFpCbpefES/neM3bQpknP DKxdNhxLEpTn3HbcseQstMMMW4ozUPdZAHBhXYuy7d4wL4XUUPWqSQ6mz/W4YFfGskYM uYBCSZpsIQYORFVEARPb/BNvxZttcb7fFuZ/fEMyDd43VkwCl9aFxZSArEMUli+z6lBj CjZKsDSfubFH3sPHGRjSkbNU9ZTM1yq3Mz7HUplPa/GNGugEeCXvkOvQKFOHNXCYbu3g zrVA== 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:dkim-signature; bh=nXek4RJi9uTxF+VRaNkUsahj/OZ3iK3n3IUnrhElzu4=; b=GlUc7k9nZDmq3C3tIBMtxIw8ZDaFcGnhBYjMwZq0TzReBeCzw0p/b9/6xErnup517i JJU6FF18VgMIp8R5E7aSyYkOE2N4bx+1v/0h3SDHEHqcKvOG04dcZ5KqYisH6wh/pGdT TFdRsqyu/ljhbVnEIPdStP6F9IlQz8WrRt+K0QpIo2yIB5rOSyJz4yN3Fc4mK866udRf mXlX5JIddW4yIVu6SYex6gaJxU30c63NdgvjixzQxtL3tuA7UE5GdxKGLXIYhKooDLV8 L6NtauWHjcgmtRtADDZsQuRWaBKnZ0RhflIpBDRxDw/jxHBudZ+mMfbH0sMdAGRzKKnQ 6r8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=TqlIn+3B; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mj7si507409ejb.531.2020.10.06.19.17.20; Tue, 06 Oct 2020 19:17:44 -0700 (PDT) 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; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=TqlIn+3B; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbgJGCQZ (ORCPT + 99 others); Tue, 6 Oct 2020 22:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbgJGCQY (ORCPT ); Tue, 6 Oct 2020 22:16:24 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9830C061755; Tue, 6 Oct 2020 19:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=nXek4RJi9uTxF+VRaNkUsahj/OZ3iK3n3IUnrhElzu4=; b=TqlIn+3B+GF53KTsWyNoJGvuRL IQFzLbK1UX+/QX6DweTdDzp5DWs4OEty0JjroINPYUMhLdj/8qfv6eMd2iCWiYjOOXe8oqkUDJ7pL g/y+HzOGh5Mw9d6wa5n+zrJ4PGzLthMFMQl77PUyDonXAvF2LHx74Zq0RZYWl0Y09nO3Bi7jiAhzJ p7f3eDDnVYfrGEVJv81dYnQfPpVRlmhaN/1yq6859Fc+dvWrRV92VAA2YK7eU/+yGBLFnT71bVE15 HF6P8xhYxHQli01y+tCerel5LVePAhq+LqLsjHO0i/TSfidTsv9wmz5Z02l9eCvdvtQFPhs3JtWWi L/pziVqA==; Received: from [2601:1c0:6280:3f0::2c9a] (helo=smtpauth.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPz08-0004Rz-1w; Wed, 07 Oct 2020 02:16:20 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org, bpf@vger.kernel.org, Martin KaFai Lau , linux-next@vger.kernel.org Subject: [PATCH bpf-next] kernel/bpf/verifier: fix build when NET is not enabled Date: Tue, 6 Oct 2020 19:16:13 -0700 Message-Id: <20201007021613.13646-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix build errors in kernel/bpf/verifier.c when CONFIG_NET is not enabled. ../kernel/bpf/verifier.c:3995:13: error: ‘btf_sock_ids’ undeclared here (not in a function); did you mean ‘bpf_sock_ops’? .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON], ../kernel/bpf/verifier.c:3995:26: error: ‘BTF_SOCK_TYPE_SOCK_COMMON’ undeclared here (not in a function); did you mean ‘PTR_TO_SOCK_COMMON’? .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON], Fixes: 1df8f55a37bd ("bpf: Enable bpf_skc_to_* sock casting helper to networking prog type") Signed-off-by: Randy Dunlap Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: netdev@vger.kernel.org Cc: bpf@vger.kernel.org Cc: Martin KaFai Lau Cc: linux-next@vger.kernel.org --- First reported by me in linux-next-20200928. kernel/bpf/verifier.c | 4 ++++ 1 file changed, 4 insertions(+) --- mmotm-2020-1006-1550.orig/kernel/bpf/verifier.c +++ mmotm-2020-1006-1550/kernel/bpf/verifier.c @@ -3984,6 +3984,7 @@ static const struct bpf_reg_types sock_t }, }; +#ifdef CONFIG_NET static const struct bpf_reg_types btf_id_sock_common_types = { .types = { PTR_TO_SOCK_COMMON, @@ -3994,6 +3995,7 @@ static const struct bpf_reg_types btf_id }, .btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK_COMMON], }; +#endif static const struct bpf_reg_types mem_types = { .types = { @@ -4037,7 +4039,9 @@ static const struct bpf_reg_types *compa [ARG_PTR_TO_CTX] = &context_types, [ARG_PTR_TO_CTX_OR_NULL] = &context_types, [ARG_PTR_TO_SOCK_COMMON] = &sock_types, +#ifdef CONFIG_NET [ARG_PTR_TO_BTF_ID_SOCK_COMMON] = &btf_id_sock_common_types, +#endif [ARG_PTR_TO_SOCKET] = &fullsock_types, [ARG_PTR_TO_SOCKET_OR_NULL] = &fullsock_types, [ARG_PTR_TO_BTF_ID] = &btf_ptr_types,