Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5438240imm; Tue, 18 Sep 2018 09:30:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZXDR52PAKfCz+2CbGtXzPRZQzubZWKyGDwucXUVhCdSKlJrPftdhi2N10h3C7ntncgNxl7 X-Received: by 2002:a65:6398:: with SMTP id h24-v6mr28881815pgv.245.1537288238311; Tue, 18 Sep 2018 09:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537288238; cv=none; d=google.com; s=arc-20160816; b=OnrI783tKacXCLz9L6hd8mM9Zc4kF9CPOtCyJd9KSwOdAO4M7Sa3i0wmrM8l1lozJm tVy2HDvU3YwyBXd9ylCrkMYPCAvFjoORlhpAwY4dHZOkwxHDOSMQ7+TYZ8nuQwqXiGXE JkANcBHjl5wUUe4sQLTHgJ6MfkDjJo+9l8Bd6AIAcwswWdYywcd2fPdcRuBmb2N+T9mS 83A8sAWhrbXYdqN/wF1lF/0pyr2TEnucPwK5luTiV/kuMQB0TQcYTYvKapHzTRsPdSIM t0oZwS1qMNpEh/amvbNR3p1L7CnmPeutfZ3NmCeOToiDARFZhHzwA1dx6blkKrXpDzBM wFFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qIA8zOCECTcKows+uTc5YbM8xE143Bi/O52cX3iDyNE=; b=got0rrWyJIVedNWCqZ+VUA2XjTCNtxxVTYPgyJyUqQRGlNw6Dl3Jn0vYI8SWu1iczX YqDuABQd7CXJAJtTiBka6YG8+j/qtXWcetHdiE3mjeXbdZzhn4VB1JL7zzMjYAw9WYHC zEkZK2ja2McDHTEjAJVzk0CGUm46d25BIuq5zM4fCthHYTUoyGxy9ISUG/uL0l/5RTnn C0q173kpHZMevRAW1+uEQ+2d3G1cmvyX4PFfePWiTHGtUq8B56gkgdx1v3uV1Qnpsw+V k15rOfjVpkhbR+ANZNtsjckjJ+tVaw+EgQisqVYlgE/l2v3TGYMsgJAcUBUxQACCp5iF yzZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oz+VWzus; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r130-v6si17501567pgr.456.2018.09.18.09.30.22; Tue, 18 Sep 2018 09:30:38 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oz+VWzus; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730229AbeIRWB4 (ORCPT + 99 others); Tue, 18 Sep 2018 18:01:56 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:45832 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728065AbeIRWB4 (ORCPT ); Tue, 18 Sep 2018 18:01:56 -0400 Received: by mail-ed1-f68.google.com with SMTP id p52-v6so2421870eda.12; Tue, 18 Sep 2018 09:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qIA8zOCECTcKows+uTc5YbM8xE143Bi/O52cX3iDyNE=; b=oz+VWzusYi8UAUgSVCOwiDoyCEwUN0nvLpJHuGhmZR8kTv/r4i00ry9TKuFrHQ4O3g K2ClUs8l9MkiCxwiTCx9iaUGfybEmvMIys81oZW7aXqgxRv1kWVbzxu9eAEN9M1lIP3U oN/Jd6mHZQdNHuvlY2Qy/3TF2pFo1cFXDpToFe/DFaIdcU/soob/P4bGP1myurV53XiA ZLCZSgbZ0rns8roAaE1nIdvz+dXslYg3cHIQASamRFdvo0naPxKHXWW5hQKn0mvhRzWB OyYR4TL2YT/J3nVhuTboXq10S8Yb8KgCq5uAA+1bvdnSwQdVT4Sx1d8fim4J6TOx2I47 oMPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qIA8zOCECTcKows+uTc5YbM8xE143Bi/O52cX3iDyNE=; b=nume5z7FhTI/7AgTpKMpPPqUH9P+jPT7C0xDFTzwoSYwjTt+M/V7wBK4+DC2qI1yOB QWIl0YbQBIFZg47CX+hVwPmgWgyjPxyhcNoPGzYtYPa3H3/yEGkBfy8EoxpP59DspP+I 7H6moN+um1HC8gLp3VqEJJsWivVRLXAA6DrVj9X8ud362vIL+OhczsldcSlDDzLzrXHa i2i5GPCAJzFazYj79jwTm/+5tCh3q1rpWVxhV94ARksC4fX3Rsd1dJuh2fPMoxkrloiC Zw6f02IRDqb4kiE4q9pL0oYXTBKy+zNGE77USFNPMCaEkTxeSPZOs3XUtpJMKGp6fQTX 5Tnw== X-Gm-Message-State: APzg51AOqv4j5cvF1AVoxgPrw5/zo+1k5fSmdKQ7wLWNNShG84LkUAu/ roEupxFiqiNhUMxZPMOqJBEPLd+l335YJCG3zvc= X-Received: by 2002:a50:fa0a:: with SMTP id b10-v6mr2397687edq.138.1537288114083; Tue, 18 Sep 2018 09:28:34 -0700 (PDT) MIME-Version: 1.0 References: <20180918151235.4284275f@canb.auug.org.au> <0dc91212-54e8-d2f0-a4e3-30a468c20b8d@infradead.org> In-Reply-To: From: Willem de Bruijn Date: Tue, 18 Sep 2018 12:28:04 -0400 Message-ID: Subject: Re: linux-next: Tree for Sep 18 (kernel/bpf/syscall) To: Daniel Borkmann Cc: rdunlap@infradead.org, Stephen Rothwell , Linux-Next Mailing List , LKML , Network Development , Alexei Starovoitov , Petar Penkov , Willem de Bruijn Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 18, 2018 at 11:44 AM Daniel Borkmann wrote: > > [ Cc Petar and Willem ] > > On 09/18/2018 05:37 PM, Randy Dunlap wrote: > > On 9/17/18 10:12 PM, Stephen Rothwell wrote: > >> Hi all, > >> > >> Changes since 20180913: > > > > on i386 or x86_64: (in 6 of 20 randconfigs) > > > > kernel/bpf/syscall.o: In function `__x64_sys_bpf': > > syscall.c:(.text+0x3278): undefined reference to `skb_flow_dissector_bpf_prog_attach' > > syscall.c:(.text+0x3310): undefined reference to `skb_flow_dissector_bpf_prog_detach' > > kernel/bpf/syscall.o:(.rodata+0x3f0): undefined reference to `flow_dissector_prog_ops' > > kernel/bpf/verifier.o:(.rodata+0x250): undefined reference to `flow_dissector_verifier_ops' > > > > Full randconfig file is attached. > > Looks like we need a wrapper for these, config had: > > # CONFIG_NET is not set Thanks for forwarding the report. For the functions, I think we can use a similar static inline stub as used e.g., for bpf_map_offload_map_alloc. The _ops references are from a macro that includes linux/bpf_types.h, so indeed a CONFIG looks needed. I need to look it over before I send out, but tentative patch: diff --git a/include/linux/bpf_types.h b/include/linux/bpf_types.h index 22083712dd18..f57fa5a6be8f 100644 --- a/include/linux/bpf_types.h +++ b/include/linux/bpf_types.h @@ -32,7 +32,9 @@ BPF_PROG_TYPE(BPF_PROG_TYPE_LIRC_MODE2, lirc_mode2) #ifdef CONFIG_INET BPF_PROG_TYPE(BPF_PROG_TYPE_SK_REUSEPORT, sk_reuseport) #endif +#ifdef CONFIG_NET BPF_PROG_TYPE(BPF_PROG_TYPE_FLOW_DISSECTOR, flow_dissector) +#endif BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops) BPF_MAP_TYPE(BPF_MAP_TYPE_PERCPU_ARRAY, percpu_array_map_ops) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ce0e863f02a2..d26a21f10cec 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1194,10 +1194,23 @@ void skb_flow_dissector_init(struct flow_dissector *flow_dissector, const struct flow_dissector_key *key, unsigned int key_count); +#if defined(CONFIG_NET) && defined(CONFIG_BPF_SYSCALL) int skb_flow_dissector_bpf_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog); int skb_flow_dissector_bpf_prog_detach(const union bpf_attr *attr); +#else +static inline int skb_flow_dissector_bpf_prog_attach(const union bpf_attr *attr, + struct bpf_prog *prog) +{ + return -EOPNOTSUPP; +} + +static inline int skb_flow_dissector_bpf_prog_detach(const union bpf_attr *attr) +{ + return -EOPNOTSUPP; +} +#endif