From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH] netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1' Date: Mon, 09 Oct 2017 14:01:34 +0200 Message-ID: <59DB651E.60409@iogearbox.net> References: <20171006160242.4403-1-shmulik@nsof.io> <20171009111823.GA30637@salvia> <20171009115736.GA31826@salvia> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Shmulik Ladkani , netfilter-devel , Willem de Bruijn , Network Development , Rafael Buchbinder , Shmulik Ladkani To: Pablo Neira Ayuso , Willem de Bruijn Return-path: Received: from www62.your-server.de ([213.133.104.62]:40885 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbdJIMBi (ORCPT ); Mon, 9 Oct 2017 08:01:38 -0400 In-Reply-To: <20171009115736.GA31826@salvia> Sender: netfilter-devel-owner@vger.kernel.org List-ID: Hi Shmulik, On 10/09/2017 01:57 PM, Pablo Neira Ayuso wrote: > On Mon, Oct 09, 2017 at 01:18:23PM +0200, Pablo Neira Ayuso wrote: >> On Fri, Oct 06, 2017 at 01:40:13PM -0400, Willem de Bruijn wrote: >>> On Fri, Oct 6, 2017 at 12:02 PM, Shmulik Ladkani wrote: >>>> From: Shmulik Ladkani >>>> >>>> Commit 2c16d6033264 ("netfilter: xt_bpf: support ebpf") introduced >>>> support for attaching an eBPF object by an fd, with the >>>> 'bpf_mt_check_v1' ABI expecting the '.fd' to be specified upon each >>>> IPT_SO_SET_REPLACE call. >>>> >>>> However this breaks subsequent iptables calls: >>>> >>>> # iptables -A INPUT -m bpf --object-pinned /sys/fs/bpf/xxx -j ACCEPT >>>> # iptables -A INPUT -s 5.6.7.8 -j ACCEPT >>>> iptables: Invalid argument. Run `dmesg' for more information. >> [...] >>>> >>>> References: [1] https://marc.info/?l=netfilter-devel&m=150564724607440&w=2 >>>> [2] https://marc.info/?l=netfilter-devel&m=150575727129880&w=2 >>>> >>>> Cc: Pablo Neira Ayuso >>>> Cc: Willem de Bruijn >>>> Reported-by: Rafael Buchbinder >>>> Signed-off-by: Shmulik Ladkani >>> >>> Acked-by: Willem de Bruijn >> >> Applied, thanks. > > Hm, I have to keep this back. Compilation breaks here. > > net/netfilter/xt_bpf.c: In function ‘__bpf_mt_check_path’: > net/netfilter/xt_bpf.c:59:2: error: implicit declaration of function > ‘bpf_obj_get_user’ [-Werror=implicit-function-declaration] > fd = bpf_obj_get_user(path); > ^ Yeah, probably best to just add a dummy bpf_obj_get_user() returning an error when CONFIG_BPF_SYSCALL is disabled.