Re: WARNING: kmalloc bug in bpf_prog_array_copy_info

2018-02-14 Thread Daniel Borkmann
On 02/14/2018 01:36 PM, Daniel Borkmann wrote: > On 02/14/2018 12:59 AM, syzbot wrote: >> Hello, >> >> syzbot hit the following crash on bpf-next commit >> 7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (Sun Feb 11 23:04:29 2018 +) >> Linux 4.16-rc1 >> >>

Re: [PATCH net] bpf: cpumap: use GFP_KERNEL instead of GFP_ATOMIC in __cpu_map_entry_alloc()

2018-02-14 Thread Daniel Borkmann
m > Fixes: 0bf7800f1799 ("ptr_ring: try vmalloc() when kmalloc() fails") > Cc: Michal Hocko > Cc: Daniel Borkmann > Cc: Matthew Wilcox > Cc: Jesper Dangaard Brouer > Cc: a...@linux-foundation.org > Cc: dhowe...@redhat.com > Cc: han...@cmpxchg.org > Signed-off-by: Jason Wang Applied to bpf tree, thanks Jason!

Re: WARNING in kvmalloc_node

2018-02-14 Thread Daniel Borkmann
On 02/14/2018 01:47 PM, Jason Wang wrote: > On 2018年02月14日 20:29, Jesper Dangaard Brouer wrote: >> On Wed, 14 Feb 2018 13:17:18 +0100 >> Daniel Borkmann wrote: >>> On 02/14/2018 01:02 PM, Jason Wang wrote: >>>> On 2018年02月14日 19:51, Michal Hocko wrote: >&g

Re: WARNING: kmalloc bug in bpf_prog_array_copy_info

2018-02-14 Thread Daniel Borkmann
On 02/14/2018 12:59 AM, syzbot wrote: > Hello, > > syzbot hit the following crash on bpf-next commit > 7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (Sun Feb 11 23:04:29 2018 +) > Linux 4.16-rc1 > > So far this crash happened 362 times on bpf-next. > C reproducer is attached. > syzkaller reproduce

Re: WARNING in kvmalloc_node

2018-02-14 Thread Daniel Borkmann
On 02/14/2018 01:02 PM, Jason Wang wrote: > On 2018年02月14日 19:51, Michal Hocko wrote: >> On Wed 14-02-18 19:47:30, Jason Wang wrote: >>> On 2018年02月14日 17:28, Daniel Borkmann wrote: >>>> [ +Jason, +Jesper ] >>>> >>>> On 02/14/2018 09:43

Re: WARNING in kvmalloc_node

2018-02-14 Thread Daniel Borkmann
[ +Jason, +Jesper ] On 02/14/2018 09:43 AM, Michal Hocko wrote: > On Tue 13-02-18 18:55:33, Matthew Wilcox wrote: >> On Tue, Feb 13, 2018 at 03:59:01PM -0800, syzbot wrote: > [...] >>> kvmalloc include/linux/mm.h:541 [inline] >>> kvmalloc_array include/linux/mm.h:557 [inline] >>> __ptr_ring_ini

Re: lost connection to test machine (4)

2018-02-12 Thread Daniel Borkmann
On 02/12/2018 05:03 PM, Dmitry Vyukov wrote: > On Mon, Feb 12, 2018 at 5:00 PM, syzbot > wrote: >> Hello, >> >> syzbot hit the following crash on bpf-next commit >> 617aebe6a97efa539cc4b8a52adccd89596e6be0 (Sun Feb 4 00:25:42 2018 +) >> Merge tag 'usercopy-v4.16-rc1' of >> git://git.kernel.org

Re: [kmemleak] unreferenced object 0xcd9c1a80 (size 192):

2018-02-12 Thread Daniel Borkmann
On 02/12/2018 06:47 AM, Yonghong Song wrote: > On 2/11/18 11:18 AM, Mathieu Malaterre wrote: >> On Sun, Feb 11, 2018 at 5:54 PM, Alexei Starovoitov >> wrote: >>> On Sun, Feb 11, 2018 at 7:24 AM, Mathieu Malaterre wrote: Alexei, Could you please comment on why I am seeing those meml

Re: [Resend] Question: kselftests: bpf/test_maps failed

2018-02-09 Thread Daniel Borkmann
On 02/09/2018 06:14 AM, Li Zhijian wrote: > Hi > > INTEL 0-Day noticed that bpf/test_maps has different results at different > platforms. > when it fails, the details are like Sorry for the late reply and thanks for reporting! More below: > -- >   880 Failed to create hashmap ke

Re: [PATCH bpf-next v8 0/5] libbpf: add XDP binding support

2018-01-31 Thread Daniel Borkmann
On 01/30/2018 09:50 PM, Eric Leblond wrote: > Hello Daniel, > > No problem with the delay in the answer. I'm doing far worse. > > Here is an updated version: > - add if_link.h in uapi and remove the definition > - fix a commit message > - remove uapi from a include Fyi, this still needs to wait

Re: general protection fault in ___bpf_prog_run

2018-01-30 Thread Daniel Borkmann
On 01/30/2018 09:58 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on bpf-next commit > 868c36dcc949c26bc74fa4661b670d9acc6489e4 (Mon Jan 29 03:00:16 2018 +) > Merge tag 'wireless-drivers-next-for-davem-2018-01-26' of > git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wirele

Re: general protection fault in ___bpf_prog_run

2018-01-30 Thread Daniel Borkmann
On 01/30/2018 09:58 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on bpf-next commit > 868c36dcc949c26bc74fa4661b670d9acc6489e4 (Mon Jan 29 03:00:16 2018 +) > Merge tag 'wireless-drivers-next-for-davem-2018-01-26' of > git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wirele

Re: net: hang in unregister_netdevice: waiting for lo to become free

2018-01-30 Thread Daniel Borkmann
On 01/30/2018 07:32 PM, Cong Wang wrote: > On Tue, Jan 30, 2018 at 4:09 AM, Dmitry Vyukov wrote: >> Hello, >> >> The following program creates a hang in unregister_netdevice. >> cleanup_net work hangs there forever periodically printing >> "unregister_netdevice: waiting for lo to become free. Usag

Re: [PATCH bpf-next v7 3/5] libbpf: add error reporting in XDP

2018-01-30 Thread Daniel Borkmann
Hi Eric, On 01/27/2018 11:32 AM, Eric Leblond wrote: > On Sat, 2018-01-27 at 02:28 +0100, Daniel Borkmann wrote: >> On 01/25/2018 01:05 AM, Eric Leblond wrote: >>> Parse netlink ext attribute to get the error message returned by >>> the card. Code is partially take

Re: [PATCH v3 bpf] bpf: introduce BPF_JIT_ALWAYS_ON config

2018-01-29 Thread Daniel Borkmann
On 01/29/2018 06:36 PM, Greg KH wrote: > On Mon, Jan 29, 2018 at 04:36:35PM +0100, Daniel Borkmann wrote: >> On 01/29/2018 12:40 AM, Daniel Borkmann wrote: >>> On 01/28/2018 03:45 PM, Greg KH wrote: >>>> On Wed, Jan 24, 2018 at 11:10:50AM +0100, Daniel Borkmann wrote

Re: [PATCH v3 bpf] bpf: introduce BPF_JIT_ALWAYS_ON config

2018-01-29 Thread Daniel Borkmann
On 01/29/2018 12:40 AM, Daniel Borkmann wrote: > On 01/28/2018 03:45 PM, Greg KH wrote: >> On Wed, Jan 24, 2018 at 11:10:50AM +0100, Daniel Borkmann wrote: >>> On 01/24/2018 11:07 AM, David Woodhouse wrote: >>>> On Tue, 2018-01-09 at 22:39 +0100, Daniel Borkmann wrote

Re: [PATCH v3 bpf] bpf: introduce BPF_JIT_ALWAYS_ON config

2018-01-28 Thread Daniel Borkmann
On 01/28/2018 03:45 PM, Greg KH wrote: > On Wed, Jan 24, 2018 at 11:10:50AM +0100, Daniel Borkmann wrote: >> On 01/24/2018 11:07 AM, David Woodhouse wrote: >>> On Tue, 2018-01-09 at 22:39 +0100, Daniel Borkmann wrote: >>>> On 01/09/2018 07:04 PM, Alexei Starovoi

Re: [PATCH bpf-next v7 3/5] libbpf: add error reporting in XDP

2018-01-26 Thread Daniel Borkmann
On 01/25/2018 01:05 AM, Eric Leblond wrote: > Parse netlink ext attribute to get the error message returned by > the card. Code is partially take from libnl. > > We add netlink.h to the uapi include of tools. And we need to > avoid include of userspace netlink header to have a successful > build o

Re: [PATCH bpf-next v7 2/5] libbpf: add function to setup XDP

2018-01-26 Thread Daniel Borkmann
On 01/25/2018 01:05 AM, Eric Leblond wrote: > Most of the code is taken from set_link_xdp_fd() in bpf_load.c and > slightly modified to be library compliant. > > Signed-off-by: Eric Leblond > Acked-by: Alexei Starovoitov > --- > tools/lib/bpf/bpf.c| 127 > ++

Re: [PATCH net-next v1] samples/bpf: Partially fixes the bpf.o build

2018-01-26 Thread Daniel Borkmann
On 01/26/2018 09:30 AM, Mickaël Salaün wrote: > On 26/01/2018 03:16, Alexei Starovoitov wrote: >> On Fri, Jan 26, 2018 at 01:39:30AM +0100, Mickaël Salaün wrote: >>> Do not build lib/bpf/bpf.o with this Makefile but use the one from the >>> library directory. This avoid making a buggy bpf.o file (

Re: [PATCH] bpf, doc: Correct one wrong value in "Register value tracking"

2018-01-24 Thread Daniel Borkmann
On 01/24/2018 08:48 AM, Wang YanQing wrote: > If we then OR this with 0x40, then the value of 6th bit (0th is first bit) > become known, so the right mask is 0xbf instead of 0xcf. > > Signed-off-by: Wang YanQing Applied to bpf-next, thanks Wang!

Re: [PATCH v3 bpf] bpf: introduce BPF_JIT_ALWAYS_ON config

2018-01-24 Thread Daniel Borkmann
On 01/24/2018 11:07 AM, David Woodhouse wrote: > On Tue, 2018-01-09 at 22:39 +0100, Daniel Borkmann wrote: >> On 01/09/2018 07:04 PM, Alexei Starovoitov wrote: >>> >>> The BPF interpreter has been used as part of the spectre 2 attack >>> CVE-2017-5715. >

Re: [PATCH bpf-next 0/4] libbpf: add XDP binding support

2018-01-22 Thread Daniel Borkmann
On 01/20/2018 09:28 AM, Éric Leblond wrote: > Hi, > > Le 20 janv. 2018 9:21 AM, Daniel Borkmann a écrit : > > On 01/20/2018 03:27 AM, Alexei Starovoitov wrote: > > On Sat, Jan 20, 2018 at 03:00:37AM +0100, Daniel Borkmann wrote: > >> On 01/19/201

Re: [PATCH bpf-next 0/4] libbpf: add XDP binding support

2018-01-20 Thread Daniel Borkmann
On 01/20/2018 03:27 AM, Alexei Starovoitov wrote: > On Sat, Jan 20, 2018 at 03:00:37AM +0100, Daniel Borkmann wrote: >> On 01/19/2018 12:43 AM, Eric Leblond wrote: >>> Hello, >>> >>> This patchset rebases the libbpf code on latest bpf-next code and addresse

Re: [PATCH bpf-next 0/4] libbpf: add XDP binding support

2018-01-19 Thread Daniel Borkmann
On 01/19/2018 12:43 AM, Eric Leblond wrote: > Hello, > > This patchset rebases the libbpf code on latest bpf-next code and addresses > remarks by Daniel. Ok, I think it's a good start. We should later on clean up the netlink handling code a bit, but that's all internal and can be done in a second

Re: [PATCH] selftests: bpf: update .gitignore with missing generated files

2018-01-19 Thread Daniel Borkmann
On 01/19/2018 01:36 AM, Shuah Khan wrote: > Update .gitignore with missing generated files. > > Signed-off-by: Shuah Khan Applied to bpf-next, thanks Shuah!

Re: [PATCH bpf-next] bpftool: recognize BPF_PROG_TYPE_CGROUP_DEVICE programs

2018-01-19 Thread Daniel Borkmann
001 >> From: Roman Gushchin >> Date: Fri, 19 Jan 2018 14:07:38 + >> Subject: [PATCH bpf-next] bpftool: recognize BPF_MAP_TYPE_CPUMAP maps >> >> Add BPF_MAP_TYPE_CPUMAP map type to the list >> of map type recognized by bpftool and define >> correspo

Re: dangers of bots on the mailing lists was Re: divide error in ___bpf_prog_run

2018-01-18 Thread Daniel Borkmann
On 01/18/2018 02:10 PM, Dmitry Vyukov wrote: > On Wed, Jan 17, 2018 at 12:09 PM, Dmitry Vyukov wrote: >> On Wed, Jan 17, 2018 at 10:49 AM, Daniel Borkmann >> wrote: >>> Don't know if there's such a possibility, but it would be nice if we could >>>

Re: dangers of bots on the mailing lists was Re: divide error in ___bpf_prog_run

2018-01-17 Thread Daniel Borkmann
On 01/17/2018 10:32 AM, Pavel Machek wrote: > On Fri 2018-01-12 17:58:01, syzbot wrote: >> Hello, >> >> syzkaller hit the following crash on >> 19d28fbd306e7ae7c1acf05c3e6968b56f0d196b > > What an useful way to describe kernel version. > > Could we get reasonable subject line? 4.15-rc7: prefix wo

Re: [bpf-next PATCH 0/3] libbpf: cleanups to Makefile

2018-01-16 Thread Daniel Borkmann
On 01/17/2018 12:20 AM, Jesper Dangaard Brouer wrote: > This patchset contains some small improvements and cleanup for > the Makefile in tools/lib/bpf/. > > It worries me that the libbpf.so shared library is not versioned, but > it not addressed in this patchset. Looks good; applied it to bpf-nex

Re: [PATCH] samples/bpf: Fix trailing semicolon

2018-01-16 Thread Daniel Borkmann
On 01/16/2018 03:15 PM, Luis de Bethencourt wrote: > The trailing semicolon is an empty statement that does no operation. > Removing it since it doesn't do anything. > > Signed-off-by: Luis de Bethencourt Applied to bpf-next, thanks Luis!

Re: [PATCH bpf-next] bpftool: recognize BPF_PROG_TYPE_CGROUP_DEVICE programs

2018-01-15 Thread Daniel Borkmann
g textual representation: >>> >>> $ bpftool prog show >>> 1: cgroup_device name bpf_prog1 tag ac9f93dbfd6d9b74 >>> loaded_at Jan 15/07:58 uid 0 >>> xlated 96B jited 105B memlock 4096B >>> >>> Signed-off-by: Roman Gushchin >>&

Re: KASAN: use-after-free Write in array_map_update_elem

2018-01-15 Thread Daniel Borkmann
On 01/15/2018 04:07 PM, Dmitry Vyukov wrote: > On Mon, Jan 15, 2018 at 3:58 PM, syzbot > wrote: >> Hello, >> >> syzkaller hit the following crash on >> 8418f88764046d0e8ca6a3c04a69a0e57189aa1e >> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master >> compiler: gcc (GCC) 7.1.1

Re: KASAN: slab-out-of-bounds Write in array_map_update_elem

2018-01-15 Thread Daniel Borkmann
On 01/15/2018 04:07 PM, Dmitry Vyukov wrote: > On Mon, Jan 15, 2018 at 3:58 PM, syzbot > wrote: >> Hello, >> >> syzkaller hit the following crash on >> 4147d50978df60f34d444c647dde9e5b34a4315e >> git://git.cmpxchg.org/linux-mmots.git/master >> compiler: gcc (GCC) 7.1.1 20170620 >> .config is attac

Re: BUG: unable to handle kernel paging request in check_memory_region

2018-01-13 Thread Daniel Borkmann
On 01/13/2018 08:29 AM, Dmitry Vyukov wrote: > On Fri, Jan 12, 2018 at 11:58 PM, syzbot > wrote: >> Hello, >> >> syzkaller hit the following crash on >> c92a9a461dff6140c539c61e457aa97df29517d6 >> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/master >> compiler: gcc (GCC) 7.1.1

Re: general protection fault in __bpf_map_put

2018-01-13 Thread Daniel Borkmann
On 01/13/2018 08:16 AM, Dmitry Vyukov wrote: > On Wed, Jan 10, 2018 at 1:58 PM, syzbot > wrote: >> Hello, >> >> syzkaller hit the following crash on >> b4464bcab38d3f7fe995a7cb960eeac6889bec08 >> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master >> compiler: gcc (GCC) 7.1.1

Re: divide error in ___bpf_prog_run

2018-01-13 Thread Daniel Borkmann
On 01/13/2018 02:58 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on 19d28fbd306e7ae7c1acf05c3e6968b56f0d196b > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is attached. >

Re: KASAN: slab-out-of-bounds Read in map_lookup_elem

2018-01-13 Thread Daniel Borkmann
On 01/13/2018 02:58 AM, syzbot wrote: > Hello, > > syzkaller hit the following crash on 19d28fbd306e7ae7c1acf05c3e6968b56f0d196b > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is attached. >

Re: linux-next: build failure after merge of the net-next tree

2018-01-12 Thread Daniel Borkmann
On 01/12/2018 04:56 PM, Alexei Starovoitov wrote: > On Fri, Jan 12, 2018 at 11:45:42AM +0100, Daniel Borkmann wrote: >> On 01/12/2018 05:21 AM, Alexei Starovoitov wrote: >>> On Thu, Jan 11, 2018 at 10:11:45PM -0500, David Miller wrote: >>>> From: Alexei Starovoitov

Re: linux-next: build failure after merge of the net-next tree

2018-01-12 Thread Daniel Borkmann
On 01/12/2018 05:21 AM, Alexei Starovoitov wrote: > On Thu, Jan 11, 2018 at 10:11:45PM -0500, David Miller wrote: >> From: Alexei Starovoitov >> Date: Wed, 10 Jan 2018 17:58:54 -0800 >> >>> On Thu, Jan 11, 2018 at 11:53:55AM +1100, Stephen Rothwell wrote: Hi all, After merging the n

Re: [PATCH 00/18] prevent bounds-check bypass via speculative execution

2018-01-11 Thread Daniel Borkmann
On 01/11/2018 04:58 PM, Dan Williams wrote: > On Thu, Jan 11, 2018 at 1:54 AM, Jiri Kosina wrote: >> On Tue, 9 Jan 2018, Josh Poimboeuf wrote: >>> On Tue, Jan 09, 2018 at 11:44:05AM -0800, Dan Williams wrote: On Tue, Jan 9, 2018 at 11:34 AM, Jiri Kosina wrote: > On Fri, 5 Jan 2018, Dan W

Re: KASAN: use-after-free Read in __bpf_prog_put

2018-01-11 Thread Daniel Borkmann
Hi Dmitry, On 01/11/2018 11:22 AM, Dmitry Vyukov wrote: > On Thu, Jan 11, 2018 at 11:17 AM, syzbot > wrote: >> Hello, >> >> syzkaller hit the following crash on >> 4147d50978df60f34d444c647dde9e5b34a4315e >> git://git.cmpxchg.org/linux-mmots.git/master >> compiler: gcc (GCC) 7.1.1 20170620 >> .co

Re: WARNING in ___bpf_prog_run

2018-01-10 Thread Daniel Borkmann
On 01/10/2018 06:31 PM, syzbot wrote: > Hello, > > syzkaller hit the following crash on b4464bcab38d3f7fe995a7cb960eeac6889bec08 > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is attached. >

Re: general protection fault in cgroup_fd_array_put_ptr

2018-01-10 Thread Daniel Borkmann
On 01/10/2018 04:30 PM, Daniel Borkmann wrote: > On 01/10/2018 01:58 PM, syzbot wrote: >> Hello, >> >> syzkaller hit the following crash on b4464bcab38d3f7fe995a7cb960eeac6889bec08 >> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master >> c

Re: general protection fault in cgroup_fd_array_put_ptr

2018-01-10 Thread Daniel Borkmann
On 01/10/2018 01:58 PM, syzbot wrote: > Hello, > > syzkaller hit the following crash on b4464bcab38d3f7fe995a7cb960eeac6889bec08 > git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is attached. >

Re: [PATCH][bpf-next] bpf: fix spelling mistake: "obusing" -> "abusing"

2018-01-10 Thread Daniel Borkmann
On 01/10/2018 10:20 AM, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in error message text. > > Signed-off-by: Colin Ian King > --- > kernel/bpf/verifier.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/bpf/verifier.c b/kernel/b

Re: [PATCH v3 bpf] bpf: introduce BPF_JIT_ALWAYS_ON config

2018-01-09 Thread Daniel Borkmann
On 01/09/2018 07:04 PM, Alexei Starovoitov wrote: > The BPF interpreter has been used as part of the spectre 2 attack > CVE-2017-5715. > > A quote from goolge project zero blog: > "At this point, it would normally be necessary to locate gadgets in > the host kernel code that can be used to actual

Re: [PATCH v2 bpf] bpf: introduce BPF_JIT_ALWAYS_ON config

2018-01-09 Thread Daniel Borkmann
On 01/09/2018 05:52 AM, Alexei Starovoitov wrote: > The BPF interpreter has been used as part of the spectre 2 attack > CVE-2017-5715. > > A quote from goolge project zero blog: > "At this point, it would normally be necessary to locate gadgets in > the host kernel code that can be used to actual

Re: [PATCH bpf-next v5 2/4] libbpf: add error reporting in XDP

2018-01-06 Thread Daniel Borkmann
On 01/04/2018 09:21 AM, Eric Leblond wrote: > Parse netlink ext attribute to get the error message returned by > the card. Code is partially take from libnl. > > Signed-off-by: Eric Leblond > Acked-by: Alexei Starovoitov > --- > samples/bpf/Makefile | 2 +- > tools/lib/bpf/Build| 2 +-

Re: [PATCH v3 bpf-next 1/2] tools/bpftool: use version from the kernel source tree

2017-12-29 Thread Daniel Borkmann
On 12/27/2017 08:16 PM, Roman Gushchin wrote: > Bpftool determines it's own version based on the kernel > version, which is picked from the linux/version.h header. > > It's strange to use the version of the installed kernel > headers, and makes much more sense to use the version > of the actual so

Re: [PATCH] bpf: selftest for late caller stack size increase

2017-12-27 Thread Daniel Borkmann
On 12/22/2017 07:12 PM, Jann Horn wrote: > This checks that it is not possible to bypass the total stack size check in > update_stack_depth() by calling a function that uses a large amount of > stack memory *before* using a large amount of stack memory in the caller. > > Currently, the first added

Re: [PATCH 3/4] libbpf: break loop earlier

2017-12-27 Thread Daniel Borkmann
On 12/27/2017 09:30 PM, Eric Leblond wrote: > On Wed, 2017-12-27 at 11:00 -0800, Alexei Starovoitov wrote: >> On Wed, Dec 27, 2017 at 07:02:28PM +0100, Eric Leblond wrote: >>> Get out of the loop when we have a match. >>> >>> Signed-off-by: Eric Leblond >>> --- >>> tools/lib/bpf/libbpf.c | 1 + >>

Re: [PATCH v10 1/5] add infrastructure for tagging functions as error injectable

2017-12-20 Thread Daniel Borkmann
On 12/20/2017 08:13 AM, Masami Hiramatsu wrote: > On Tue, 19 Dec 2017 18:14:17 -0800 > Alexei Starovoitov wrote: [...] >> Please make your suggestion as patches based on top of bpf-next. > > bpf-next seems already pick this series. Would you mean I revert it and > write new patch? No, please sub

Re: [PATCH] bpf: make function xdp_do_generic_redirect_map() static

2017-12-18 Thread Daniel Borkmann
On 12/19/2017 12:17 AM, Xiongwei Song wrote: > The function xdp_do_generic_redirect_map() is only used in this file, so > make it static. > > Clean up sparse warning: > net/core/filter.c:2687:5: warning: no previous prototype > for 'xdp_do_generic_redirect_map' [-Wmissing-prototypes] > > Signed-o

Re: [PATCH][next] bpf: make function skip_callee static and return NULL rather than 0

2017-12-18 Thread Daniel Borkmann
On 12/18/2017 06:47 PM, Colin King wrote: > From: Colin Ian King > > Function skip_callee is local to the source and does not need to > be in global scope, so make it static. Also return NULL rather than 0. > Cleans up two sparse warnings: > > symbol 'skip_callee' was not declared. Should it be

Re: [PATCH][next] bpf: fix spelling mistake: "funcation"-> "function"

2017-12-18 Thread Daniel Borkmann
On 12/18/2017 03:03 PM, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in error message text. > > Signed-off-by: Colin Ian King Applied to bpf-next, thanks Colin!

Re: [PATCH v10 3/5] bpf: add a bpf_override_function helper

2017-12-18 Thread Daniel Borkmann
On 12/18/2017 10:51 AM, Masami Hiramatsu wrote: > On Fri, 15 Dec 2017 14:12:54 -0500 > Josef Bacik wrote: >> From: Josef Bacik >> >> Error injection is sloppy and very ad-hoc. BPF could fill this niche >> perfectly with it's kprobe functionality. We could make sure errors are >> only triggered

Re: [PATCH] trace: reenable preemption if we modify the ip

2017-12-17 Thread Daniel Borkmann
On 12/16/2017 03:42 AM, Josef Bacik wrote: > From: Josef Bacik > > Things got moved around between the original bpf_override_return patches > and the final version, and now the ftrace kprobe dispatcher assumes if > you modified the ip that you also enabled preemption. Make a comment of > this an

Re: [PATCH v10 3/5] bpf: add a bpf_override_function helper

2017-12-15 Thread Daniel Borkmann
On 12/15/2017 09:34 PM, Alexei Starovoitov wrote: [...] > Also how big is the v9-v10 change ? > May be do it as separate patch, since previous set already sitting > in bpf-next and there are patches on top? +1

Re: [PATCH v4 net-next 0/4] bpftool: cgroup bpf operations

2017-12-14 Thread Daniel Borkmann
On 12/13/2017 04:18 PM, Roman Gushchin wrote: > This patchset adds basic cgroup bpf operations to bpftool. > > Right now there is no convenient way to perform these operations. > The /samples/bpf/load_sock_ops.c implements attach/detacg operations, > but only for BPF_CGROUP_SOCK_OPS programs. Bps

Re: [PATCH net-next] libbpf: add function to setup XDP

2017-12-11 Thread Daniel Borkmann
On 12/10/2017 10:07 PM, David Ahern wrote: > On 12/10/17 1:34 PM, Eric Leblond wrote: >>> Would it be possible to print out or preferably return to the caller >>> the ext ack error message? A couple of drivers are using it for XDP >>> mis-configuration reporting instead of printks. We should enco

Re: Linux 4.15-rc3 (uml + bpf_perf_event.h)

2017-12-11 Thread Daniel Borkmann
On 12/11/2017 06:27 PM, Randy Dunlap wrote: > On 12/11/2017 02:19 AM, Daniel Borkmann wrote: >> Hi Randy, hi Richard, [ +Hendrik for c895f6f703ad7dd2f ] >> >> On 12/11/2017 09:32 AM, Richard Weinberger wrote: >>> Randy, >>> >>> Am Montag, 11.

Re: Linux 4.15-rc3 (uml + bpf_perf_event.h)

2017-12-11 Thread Daniel Borkmann
Hi Randy, hi Richard, [ +Hendrik for c895f6f703ad7dd2f ] On 12/11/2017 09:32 AM, Richard Weinberger wrote: > Randy, > > Am Montag, 11. Dezember 2017, 03:42:12 CET schrieb Randy Dunlap: >> On 12/10/2017 06:08 PM, Linus Torvalds wrote: >>> Another week, another rc. >> >> um (uml) won't build on i38

Re: [PATCH v8 0/5] Add the ability to do BPF directed error injection

2017-12-08 Thread Daniel Borkmann
On 12/08/2017 09:24 PM, Josef Bacik wrote: > On Fri, Dec 08, 2017 at 04:35:44PM +0100, Daniel Borkmann wrote: >> On 12/06/2017 05:12 PM, Josef Bacik wrote: >>> Jon noticed that I had a typo in my _ASM_KPROBE_ERROR_INJECT macro. I went >>> to >>> figure out

Re: [PATCH v5 0/6] enable creating [k,u]probe with perf_event_open

2017-12-08 Thread Daniel Borkmann
On 12/06/2017 11:45 PM, Song Liu wrote: > Changes PATCH v4 to PATCH v5: > Remove PERF_PROBE_CONFIG_IS_RETPROBE from uapi, use PMU_FORMAT_ATTR > instead. > > Changes PATCH v3 to PATCH v4: > Remove uapi define MAX_PROBE_FUNC_NAME_LEN, use KSYM_NAME_LEN instead. > Add flag PERF_PROBE_CONFIG_I

Re: [PATCH v8 0/5] Add the ability to do BPF directed error injection

2017-12-08 Thread Daniel Borkmann
On 12/06/2017 05:12 PM, Josef Bacik wrote: > Jon noticed that I had a typo in my _ASM_KPROBE_ERROR_INJECT macro. I went to > figure out why the compiler didn't catch it and it's because it was not used > anywhere. I had copied it from the trace blacklist code without understanding > where it was

Re: [PATCH] netlink: Add netns check on taps

2017-12-06 Thread Daniel Borkmann
On 12/06/2017 08:40 PM, David Miller wrote: > From: Kevin Cernekee > Date: Tue, 5 Dec 2017 14:46:22 -0800 > >> Currently, a nlmon link inside a child namespace can observe systemwide >> netlink activity. Filter the traffic so that in a non-init netns, >> nlmon can only sniff netlink messages fr

Re: [PATCH v2 0/6] bpf: correct broken uapi for BPF_PROG_TYPE_PERF_EVENT program type

2017-12-05 Thread Daniel Borkmann
On 12/05/2017 04:53 PM, Daniel Borkmann wrote: > On 12/04/2017 10:56 AM, Hendrik Brueckner wrote: >> Perf tool bpf selftests revealed a broken uapi for s390 and arm64. >> With the BPF_PROG_TYPE_PERF_EVENT program type the bpf_perf_event >> structure exports the pt_r

Re: [PATCH v2 0/6] bpf: correct broken uapi for BPF_PROG_TYPE_PERF_EVENT program type

2017-12-05 Thread Daniel Borkmann
On 12/04/2017 10:56 AM, Hendrik Brueckner wrote: > Perf tool bpf selftests revealed a broken uapi for s390 and arm64. > With the BPF_PROG_TYPE_PERF_EVENT program type the bpf_perf_event > structure exports the pt_regs structure for all architectures. > > This fails for s390 and arm64 because pt_re

Re: netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'

2017-12-04 Thread Daniel Borkmann
On 12/02/2017 07:48 PM, Al Viro wrote: > On Fri, Dec 01, 2017 at 09:47:00PM +0100, Daniel Borkmann wrote: >>> Might want to replace security_path_mknod() with something saner, while we >>> are >>> at it. >>> >>> Objections? >> >> No,

Re: netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'

2017-12-01 Thread Daniel Borkmann
On 12/01/2017 04:48 AM, Al Viro wrote: > On Fri, Dec 01, 2017 at 01:33:04AM +, Al Viro wrote: > >> Use of file descriptors should be limited to "got a number from userland, >> convert to struct file *" on the way in and "install struct file * into >> descriptor table and return the descriptor

Re: netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'

2017-12-01 Thread Daniel Borkmann
On 12/01/2017 06:39 PM, Al Viro wrote: [...] > If that does not scream "wrong or missing primitive", I don't know what would. > You want something along the lines of "create a filesystem object at given > location, calling this function with this argument for actual object > creation"? > Fair enou

Re: netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'

2017-12-01 Thread Daniel Borkmann
On 12/01/2017 07:28 PM, Linus Torvalds wrote: > [ Sorry for HTML email crud - traveling and on mobile right now ] > > On Nov 30, 2017 23:54, "Al Viro" wrote: > > Would cause problems for tracepoints in there, though. And that, BTW, > is precisely why I don't want tracepoints in core VFS, TYVM -

Re: [PATCH] bpf: Fix compile warnings when !CONFIG_BPF_SYSCALL

2017-12-01 Thread Daniel Borkmann
On 12/01/2017 08:06 PM, Jason Gunthorpe wrote: > Such as: > > In file included from ./include/trace/events/xdp.h:10:0, > from ./include/linux/bpf_trace.h:6, > from drivers/net/ethernet/intel/i40e/i40e_txrx.c:29: > ./include/trace/events/xdp.h:94:17: warning: ‘stru

Re: [PATCH v3 0/6] enable creating [k,u]probe with perf_event_open

2017-12-01 Thread Daniel Borkmann
On 12/01/2017 12:50 AM, Song Liu wrote: > Changes PATCH v2 to PATCH v3: > Remove fixed type PERF_TYPE_KPROBE and PERF_TYPE_UPROBE, use dynamic > type instead. > Update userspace (samples/bpf, bcc) to look up type from sysfs. > Change License info in test_many_kprobe_user.c as Philippe Ombre

Re: [PATCH resend] trace/xdp: fix compile warning: 'struct bpf_map' declared inside parameter list

2017-11-29 Thread Daniel Borkmann
On 11/30/2017 02:41 AM, Xie XiuQi wrote: > We meet this compile warning, which caused by missing bpf.h in xdp.h. > > In file included from ./include/trace/events/xdp.h:10:0, > from ./include/linux/bpf_trace.h:6, > from drivers/net/ethernet/intel/i40e/i40e_txrx.c:2

Re: [PATCH v7 1/5] add infrastructure for tagging functions as error injectable

2017-11-29 Thread Daniel Borkmann
On 11/28/2017 09:02 PM, Josef Bacik wrote: > On Tue, Nov 28, 2017 at 11:58:41AM -0700, Jonathan Corbet wrote: >> On Wed, 22 Nov 2017 16:23:30 -0500 >> Josef Bacik wrote: >>> From: Josef Bacik >>> >>> Using BPF we can override kprob'ed functions and return arbitrary >>> values. Obviously this can

Re: [PATCH] trace/xdp: fix compile warning: ‘struct bpf_map’ declared inside parameter list

2017-11-29 Thread Daniel Borkmann
On 11/29/2017 10:15 AM, Jesper Dangaard Brouer wrote: > On Wed, 29 Nov 2017 16:35:01 +0800 > Xie XiuQi wrote: > >> We meet this compile warning, which caused by missing bpf.h in xdp.h. >> >> In file included from ./include/trace/events/xdp.h:10:0, >> from ./include/linux/bpf_trac

Re: [PATCH v7 0/4] Add the ability to do BPF directed error injection

2017-11-28 Thread Daniel Borkmann
On 11/22/2017 10:23 PM, Josef Bacik wrote: > This is hopefully the final version, I've addressed the comment by Igno and > added his Acks. > > v6->v7: > - moved the opt-in macro to bpf.h out of kprobes.h. > > v5->v6: > - add BPF_ALLOW_ERROR_INJECTION() tagging for functions that will support this

Re: perf test LLVM & clang 6 failing

2017-11-24 Thread Daniel Borkmann
[ +Yonghong ] On 11/24/2017 03:47 PM, Arnaldo Carvalho de Melo wrote: > FYI, just noticed, recently updated clang to version 6, from its > upstream git repo. Do you recall what was your LLVM version prior to this where it was working fine? (Wild guess from below would be the BPF inline asm suppor

Re: [PATCH v7 3/5] bpf: add a bpf_override_function helper

2017-11-24 Thread Daniel Borkmann
es us a nice > clean way to implement systematic error injection for all of our code > paths. > > Acked-by: Alexei Starovoitov > Acked-by: Ingo Molnar > Signed-off-by: Josef Bacik Series looks good to me as well; BPF bits: Acked-by: Daniel Borkmann

Re: [GIT] Networking

2017-11-15 Thread Daniel Borkmann
On 11/15/2017 09:19 PM, Linus Torvalds wrote: > On Wed, Nov 15, 2017 at 3:33 AM, David Miller wrote: >> >> Highlights: > > Lowlights: > > 1) it duplicated a commit from the hrtimer tree, which had been > cleaned up and rewritten, but then merging the second copy of the > commit re-introduced th

Re: [PATCH 2/2] samples/bpf: add a test for bpf_override_return

2017-11-07 Thread Daniel Borkmann
lexei Starovoitov Signed-off-by: Josef Bacik Acked-by: Daniel Borkmann

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-07 Thread Daniel Borkmann
atic error injection for all of our code paths. Acked-by: Alexei Starovoitov Signed-off-by: Josef Bacik BPF bits: Acked-by: Daniel Borkmann

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-03 Thread Daniel Borkmann
On 11/03/2017 03:31 PM, Josef Bacik wrote: On Fri, Nov 03, 2017 at 12:12:13AM +0100, Daniel Borkmann wrote: Hi Josef, one more issue I just noticed, see comment below: On 11/02/2017 03:37 PM, Josef Bacik wrote: [...] diff --git a/include/linux/filter.h b/include/linux/filter.h index

Re: [PATCH] EXPERT Kconfig menu: fix broken EXPERT menu

2017-11-02 Thread Daniel Borkmann
/lkml/2017/11/2/907). Signed-off-by: Randy Dunlap Cc: Andrea Arcangeli Cc: Alexei Starovoitov Cc: Daniel Borkmann For BPF bits: Acked-by: Daniel Borkmann

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-02 Thread Daniel Borkmann
Hi Josef, one more issue I just noticed, see comment below: On 11/02/2017 03:37 PM, Josef Bacik wrote: [...] diff --git a/include/linux/filter.h b/include/linux/filter.h index cdd78a7beaae..dfa44fd74bae 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -458,7 +458,8 @@ struct

Re: [PATCH 2/2] [net-next] bpf: fix out-of-bounds access warning in bpf_check

2017-11-02 Thread Daniel Borkmann
re") Signed-off-by: Arnd Bergmann Acked-by: Daniel Borkmann LGTM, and bpf_analyzer() already has proper logic to bail out for such cases (although only used by nfp right now, which is there when NET is configured anyway).

Re: [PATCH 1/2] [net-next] bpf: fix link error without CONFIG_NET

2017-11-02 Thread Daniel Borkmann
, 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 Acked-by: Daniel Borkmann

Re: [PATCH][net-next] net: sched: cls_bpf: use bitwise & rather than logical && on gen_flags

2017-11-02 Thread Daniel Borkmann
gical vs. bitwise operator") Fixes: 3f7889c4c79b ("net: sched: cls_bpf: call block callbacks for offload) Signed-off-by: Colin Ian King Acked-by: Daniel Borkmann

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-01 Thread Daniel Borkmann
On 11/01/2017 06:00 PM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. A

Re: linux-next: /home/broonie/tmpfs/next/kernel/bpf/verifier.c:

2017-10-19 Thread Daniel Borkmann
On 10/19/2017 03:55 PM, Mark Brown wrote: Hi all, After merging the net-next tree, today's linux-next build (x86allmodconfig) failed like this: /home/broonie/tmpfs/next/kernel/bpf/verifier.c: In function 'check_mem_access': /home/broonie/tmpfs/next/kernel/bpf/verifier.c:1010:12: error: passing

Re: linux-next: manual merge of the net-next tree with the net tree

2017-10-19 Thread Daniel Borkmann
On 10/19/2017 03:05 PM, Mark Brown wrote: Hi all, Today's linux-next merge of the net-next tree got a conflict in: tools/testing/selftests/bpf/test_verifier.c between commit: 28e33f9d78eef ("bpf: disallow arithmetic operations on context pointer") from the net tree and commit: 22c8

Re: [PATCH net 0/3] Fix for BPF devmap percpu allocation splat

2017-10-18 Thread Daniel Borkmann
On 10/18/2017 05:28 PM, Alexei Starovoitov wrote: On Wed, Oct 18, 2017 at 7:22 AM, Daniel Borkmann wrote: Higher prio imo would be to make the allocation itself faster though, I remember we talked about this back in May wrt hashtable, but I kind of lost track whether there was an update on

Re: [PATCH net 0/3] Fix for BPF devmap percpu allocation splat

2017-10-18 Thread Daniel Borkmann
On 10/18/2017 04:03 PM, Daniel Borkmann wrote: On 10/18/2017 03:25 PM, Tejun Heo wrote: Hello, Daniel. (cc'ing Dennis) On Tue, Oct 17, 2017 at 04:55:51PM +0200, Daniel Borkmann wrote: The set fixes a splat in devmap percpu allocation when we alloc the flush bitmap. Patch 1 is a prerequ

Re: [PATCH net 0/3] Fix for BPF devmap percpu allocation splat

2017-10-18 Thread Daniel Borkmann
On 10/18/2017 03:25 PM, Tejun Heo wrote: Hello, Daniel. (cc'ing Dennis) On Tue, Oct 17, 2017 at 04:55:51PM +0200, Daniel Borkmann wrote: The set fixes a splat in devmap percpu allocation when we alloc the flush bitmap. Patch 1 is a prerequisite for the fix in patch 2, patch 1 is rather

Re: [PATCH net 0/3] Fix for BPF devmap percpu allocation splat

2017-10-17 Thread Daniel Borkmann
On 10/17/2017 05:03 PM, David Laight wrote: From: Daniel Borkmann Sent: 17 October 2017 15:56 The set fixes a splat in devmap percpu allocation when we alloc the flush bitmap. Patch 1 is a prerequisite for the fix in patch 2, patch 1 is rather small, so if this could be routed via -net, for

[PATCH net 3/3] bpf: do not test for PCPU_MIN_UNIT_SIZE before percpu allocations

2017-10-17 Thread Daniel Borkmann
() calls which use the flag already. Signed-off-by: Daniel Borkmann --- kernel/bpf/arraymap.c | 2 +- kernel/bpf/hashtab.c | 4 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 98c0f00..e263673 100644 --- a/kernel/bpf/arraymap.c

[PATCH net 0/3] Fix for BPF devmap percpu allocation splat

2017-10-17 Thread Daniel Borkmann
_SIZE checks, which are percpu allocator internals and should not be used. Thanks! Daniel Borkmann (3): mm, percpu: add support for __GFP_NOWARN flag bpf: fix splat for illegal devmap percpu allocation bpf: do not test for PCPU_MIN_UNIT_SIZE before percpu allocations kernel/bpf/arraymap.c

[PATCH net 1/3] mm, percpu: add support for __GFP_NOWARN flag

2017-10-17 Thread Daniel Borkmann
generically by supporting the __GFP_NOWARN flag that users can then use with calling the __alloc_percpu_gfp() helper instead. Signed-off-by: Daniel Borkmann Cc: Tejun Heo Cc: Mark Rutland --- mm/percpu.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mm/percpu.c b

<    1   2   3   4   5   6   7   8   9   10   >