Re: [PATCH] net: filter: fix possible memory leak in __sk_prepare_filter()

2014-06-01 Thread Alexei Starovoitov
complete. Error is handled only in __sk_migrate_filter() while memory can still leak in the error path right after sk_chk_filter(). Signed-off-by: Leon Yu chianglun...@gmail.com Nice catch. Thanks! kmemleak confirmed the leak. Acked-by: Alexei Starovoitov a...@plumgrid.com Tested-by: Alexei

[PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
filter.c into kernel/bpf/core.c instead of net/bpf/core.c Alexei Starovoitov (2): net: filter: split filter.c into two files net: filter: split BPF out of core networking arch/Kconfig |6 +- include/linux/filter.h |2 + kernel/Makefile|1 + kernel/bpf/Makefile

[PATCH v2 net-next 2/2] net: filter: split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
seccomp selects BPF only instead of whole NET Other BPF users (like tracing filters) will select BPF only too Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- arch/Kconfig |6 +- kernel/Makefile |2 +- kernel/bpf/core.c | 21 + net/Kconfig

Re: mmotm 2014-05-09-16-17 uploaded (ptrace-ab.hi vs. net/core/filter.c)

2014-05-13 Thread Alexei Starovoitov
=um build... Acked-by: Alexei Starovoitov a...@plumgrid.com --- net/core/filter.c | 71 +-- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 9aaa05a..c442a0d 100644 --- a/net/core

Re: [patch] net, filter: make new test_bpf depend on networking

2014-05-13 Thread Alexei Starovoitov
/test_bpf.ko] undefined! ERROR: sk_run_filter_int_skb [lib/test_bpf.ko] undefined! ERROR: __alloc_skb [lib/test_bpf.ko] undefined! Add the dependency. Cc: Alexei Starovoitov a...@plumgrid.com Signed-off-by: David Rientjes rient...@google.com commit 98920ba6911c7 (net: fix test_bpf build

[PATCH RFC net-next] tracing: accelerate tracing filters with BPF

2014-05-13 Thread Alexei Starovoitov
. It is used to do 'regex'-style filter matching in the example above. All generated BPF programs can be JITed. Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- The patches for x64_64 BPF JIT were sent separately. This one is an RFC. kernel/trace/Kconfig |1 + kernel/trace/trace.h

Re: [PATCH RFC net-next] tracing: accelerate tracing filters with BPF

2014-05-13 Thread Alexei Starovoitov
On Tue, May 13, 2014 at 8:07 PM, Steven Rostedt rost...@goodmis.org wrote: On Tue, 13 May 2014 19:55:11 -0700 Alexei Starovoitov a...@plumgrid.com wrote: --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -79,6 +79,7 @@ config FTRACE_NMI_ENTER default y config EVENT_TRACING

Re: [PATCH RFC net-next] tracing: accelerate tracing filters with BPF

2014-05-13 Thread Alexei Starovoitov
On Tue, May 13, 2014 at 8:17 PM, Steven Rostedt rost...@goodmis.org wrote: On Tue, 13 May 2014 19:55:11 -0700 Alexei Starovoitov a...@plumgrid.com wrote: Tracing filters are parsing user supplied character string and constructing a predicate tree. filter_match_preds() was used to walk nodes

Re: [PATCH] deb-pkg: Fix for relative paths

2014-06-16 Thread Alexei Starovoitov
On Mon, Jun 16, 2014 at 7:18 AM, Michal Marek mma...@suse.cz wrote: When $srctree or $objtree are relative paths, we cannot change directory and refer to them in the same subshell. Do the redirection outside of the subshell to fix this. Reported-by: Ilya Dryomov idryo...@gmail.com

Re: mips:allmodconfig build failure in 3.16-rc1 due to bpf_jit code

2014-06-17 Thread Alexei Starovoitov
. Sounds great! If you find some tests are missing, please feel free to submit them as well via netdev. Best, Daniel Daniel, thank you for taking care of it so quickly :) from the BPF perspective the fix looks good: Acked-by: Alexei Starovoitov a...@plumgrid.com Markos, please do run the testsuite

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 7:16 AM, Arnaldo Carvalho de Melo a...@kernel.org wrote: Em Mon, Jun 02, 2014 at 09:24:56AM -0400, Steven Rostedt escreveu: On Mon, 2 Jun 2014 08:15:45 -0500 Jonathan Corbet cor...@lwn.net wrote: On Mon, 2 Jun 2014 00:01:44 -0700 Alexei Starovoitov a...@plumgrid.com

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 1:57 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/02/2014 09:01 AM, Alexei Starovoitov wrote: This patch set splits BPF out of core networking into generic component patch #1 splits filter.c into two logical pieces: generic BPF core and socket filters. It only

Re: [PATCH v6 net-next 1/4] net: flow_dissector: avoid multiple calls in eBPF

2014-06-02 Thread Alexei Starovoitov
extending cc-list, since I think this thread is related to bpf split thread. On Mon, Jun 2, 2014 at 5:36 AM, Daniel Borkmann dbork...@redhat.com wrote: On 05/30/2014 07:12 PM, Chema Gonzalez wrote: On Thu, May 29, 2014 at 4:54 PM, Daniel Borkmann dbork...@redhat.com wrote: I actually liked

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-02 Thread Alexei Starovoitov
On Mon, Jun 2, 2014 at 10:04 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/02/2014 05:41 PM, Alexei Starovoitov wrote: ... Glad you brought up this point :) 100% agree that current double verification done by seccomp is far from being generic and quite hard to maintain, since any

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 1:56 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/02/2014 09:02 PM, Alexei Starovoitov wrote: ... Classic has all sorts of hard coded assumptions. The whole concept of 'load from magic constant' to mean different things is flawed. We all got used to it and now

Re: [PATCH v6 net-next 1/4] net: flow_dissector: avoid multiple calls in eBPF

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 1:33 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/02/2014 06:48 PM, Alexei Starovoitov wrote: imo there are pros and cons in Daniel's and Chema's proposals for classic BPF extensions. I like Chema's a bit more, since his proposal doesn't require to change

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 1:35 PM, Daniel Borkmann dbork...@redhat.com wrote: On 06/03/2014 05:44 PM, Alexei Starovoitov wrote: ... All of your points are valid. They are right questions to ask. I just don't see why you're still arguing about first step of filter.c split, whereas your concerns

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-03 Thread Alexei Starovoitov
On Tue, Jun 3, 2014 at 2:40 PM, Chema Gonzalez ch...@google.com wrote: First of all, and just to join the crowd, kernel/bpf/ FTW. Now, I have some suggestions about eBPF. IMO classic BPF is an ISA oriented to filter (meaning returning a single integer that states how many bytes of the packet

[PATCH] pci/msi: fix memory leak in free_msi_irqs()

2014-06-04 Thread Alexei Starovoitov
/MSI: Export MSI mode using attributes, not kobjects) Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- This was found by kmemleak report: unreferenced object 0x880808eda600 (size 64): comm modprobe, pid 1526, jiffies 4294902299 (age 58422.716s) hex dump (first 32 bytes): 20 c4 66

Re: Why is (2 2) true? Is it a gcc bug?

2014-01-20 Thread Alexei Starovoitov
On Sat, Jan 18, 2014 at 3:31 AM, Dorau, Lukasz lukasz.do...@intel.com wrote: On Friday, January 17, 2014 10:44 PM Alexei Starovoitov alexei.starovoi...@gmail.com wrote: On Fri, Jan 17, 2014 at 1:02 PM, Markus Trippelsdorf mar...@trippelsdorf.de wrote: On 2014.01.17 at 11:58 -0800, Alexei

Re: ipv4_dst_destroy panic regression after 3.10.15

2014-01-21 Thread Alexei Starovoitov
On Tue, Jan 21, 2014 at 8:10 PM, dormando dorma...@rydia.net wrote: On Tue, 21 Jan 2014, Alexei Starovoitov wrote: On Tue, Jan 21, 2014 at 5:39 PM, dormando dorma...@rydia.net wrote: On Fri, Jan 17, 2014 at 11:16 PM, dormando dorma...@rydia.net wrote: On Fri, 2014-01-17 at 22:49

Re: ipv4_dst_destroy panic regression after 3.10.15

2014-01-22 Thread Alexei Starovoitov
On Tue, Jan 21, 2014 at 10:02 PM, Alexei Starovoitov alexei.starovoi...@gmail.com wrote: On Tue, Jan 21, 2014 at 8:10 PM, dormando dorma...@rydia.net wrote: On Tue, 21 Jan 2014, Alexei Starovoitov wrote: On Tue, Jan 21, 2014 at 5:39 PM, dormando dorma...@rydia.net wrote: On Fri, Jan 17

Re: might_sleep warning in filemap_fault()

2014-01-22 Thread Alexei Starovoitov
]--- On Mon, Dec 9, 2013 at 6:38 PM, Alexei Starovoitov a...@plumgrid.com wrote: Hi, seeing the following trace on 3.10.xx kernels, including 3.10.23. 3.12.4 and 3.13rc2 are fine. Is there a patch waiting to be backported? [ 96.393807] llc[2903]: segfault at 8 ip 00692da7 sp

Re: Why is (2 2) true? Is it a gcc bug?

2014-01-17 Thread Alexei Starovoitov
On Fri, Jan 17, 2014 at 5:37 AM, Dorau, Lukasz lukasz.do...@intel.com wrote: Hi My story is very simply... I applied the following patch: diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c @@ -698,8 +698,11 @@

Re: Why is (2 2) true? Is it a gcc bug?

2014-01-17 Thread Alexei Starovoitov
On Fri, Jan 17, 2014 at 9:58 AM, Alexei Starovoitov alexei.starovoi...@gmail.com wrote: On Fri, Jan 17, 2014 at 5:37 AM, Dorau, Lukasz lukasz.do...@intel.com wrote: Hi My story is very simply... I applied the following patch: diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c

Re: Why is (2 2) true? Is it a gcc bug?

2014-01-17 Thread Alexei Starovoitov
On Fri, Jan 17, 2014 at 1:02 PM, Markus Trippelsdorf mar...@trippelsdorf.de wrote: On 2014.01.17 at 11:58 -0800, Alexei Starovoitov wrote: On Fri, Jan 17, 2014 at 9:58 AM, Alexei Starovoitov alexei.starovoi...@gmail.com wrote: On Fri, Jan 17, 2014 at 5:37 AM, Dorau, Lukasz lukasz.do

Re: ipv4_dst_destroy panic regression after 3.10.15

2014-01-18 Thread Alexei Starovoitov
-rt_uncached); + list_del_init(rt-rt_uncached); spin_unlock_bh(rt_uncached_lock); } } Problem could come from this commit, in linux 3.10.23, you also could try to revert it commit 62713c4b6bc10c2d082ee1540e11b01a2b2162ab Author: Alexei Starovoitov

Re: kmem_cache_alloc panic in 3.10+

2014-01-30 Thread Alexei Starovoitov
On Thu, Jan 30, 2014 at 6:16 PM, Eric Dumazet eric.duma...@gmail.com wrote: On Wed, 2014-01-29 at 23:05 -0800, dormando wrote: We hit the routing code fairly hard. Any hints for what to look at or how to instrument it? Or if it's fixed already? It's a real pain to iterate since it takes ~30

Re: [RFC PATCH tip 0/5] tracing filters with BPF

2013-12-10 Thread Alexei Starovoitov
On Tue, Dec 10, 2013 at 7:47 AM, Ingo Molnar mi...@kernel.org wrote: * Alexei Starovoitov a...@plumgrid.com wrote: I'm fine if it becomes a requirement to have a vmlinux built with DEBUG_INFO to use BPF and have a tool like perf to translate the filters. But it that must not replace what

Re: [RFC PATCH tip 0/5] tracing filters with BPF

2013-12-11 Thread Alexei Starovoitov
On Tue, Dec 10, 2013 at 7:35 PM, Masami Hiramatsu masami.hiramatsu...@hitachi.com wrote: (2013/12/11 11:32), Alexei Starovoitov wrote: On Tue, Dec 10, 2013 at 7:47 AM, Ingo Molnar mi...@kernel.org wrote: * Alexei Starovoitov a...@plumgrid.com wrote: I'm fine if it becomes a requirement

Re: Re: [RFC PATCH tip 0/5] tracing filters with BPF

2013-12-06 Thread Alexei Starovoitov
On Fri, Dec 6, 2013 at 3:54 PM, Masami Hiramatsu masami.hiramatsu...@hitachi.com wrote: (2013/12/06 14:16), Alexei Starovoitov wrote: On Thu, Dec 5, 2013 at 5:20 PM, Andi Kleen a...@firstfloor.org wrote: the difference is bigger now: 484-145 vs 185-145 This is a obvious improvement, but imho

Re: [RFC PATCH tip 0/5] tracing filters with BPF

2013-12-06 Thread Alexei Starovoitov
On Thu, Dec 5, 2013 at 5:20 PM, Andi Kleen a...@firstfloor.org wrote: H. Peter Anvin h...@zytor.com writes: Not to mention that in that case we might as well -- since we need a compiler anyway -- generate the machine code in user space; the JIT solution really only is useful if it can provide

binary blob no more! Was: [RFC PATCH tip 0/5] tracing filters with BPF

2013-12-08 Thread Alexei Starovoitov
On Thu, Dec 5, 2013 at 9:43 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Thu, Dec 5, 2013 at 2:38 AM, Ingo Molnar mi...@kernel.org wrote: Also I'm thinking to add 'license_string' section to bpf binary format and call license_is_gpl_compatible() on it during load. If false, then just

might_sleep warning in filemap_fault()

2013-12-09 Thread Alexei Starovoitov
Hi, seeing the following trace on 3.10.xx kernels, including 3.10.23. 3.12.4 and 3.13rc2 are fine. Is there a patch waiting to be backported? [ 96.393807] llc[2903]: segfault at 8 ip 00692da7 sp 7fff1a6baf30 error 4 in llc[40+7f8000] [ 96.394304] BUG: sleeping function called

Re: [PATCH net-next v2 8/9] net: filter: rework/optimize internal BPF interpreter's instruction set

2014-03-25 Thread Alexei Starovoitov
On Tue, Mar 25, 2014 at 5:46 PM, David Miller da...@davemloft.net wrote: From: H. Peter Anvin h...@linux.intel.com Date: Tue, 25 Mar 2014 17:24:27 -0700 If you allow loops, it greatly increases the expressibility of the language, but we would really need another control to limit CPU usage.

Re: [PATCH net-next v3 8/9] net: filter: rework/optimize internal BPF interpreter's instruction set

2014-03-27 Thread Alexei Starovoitov
On Thu, Mar 27, 2014 at 12:23 PM, David Miller da...@davemloft.net wrote: From: Daniel Borkmann dbork...@redhat.com Date: Wed, 26 Mar 2014 22:06:09 +0100 - Adds swab insns for 32/64-bit I don't like this. You don't want a swab instruction, you want endian X to endian Y. Just like we

Re: [PATCH net] bridge: Add port flap detection

2014-05-04 Thread Alexei Starovoitov
On Sun, May 4, 2014 at 3:53 PM, Stephen Hemminger step...@networkplumber.org wrote: On Mon, 5 May 2014 07:29:34 +1000 Jon Maxwell jmaxwel...@gmail.com wrote: There has been a number incidents recently where customers running KVM have reported that VM hosts on different Hypervisors are

Re: RFC: A reduced Linux network stack for small systems

2014-05-06 Thread Alexei Starovoitov
On Tue, May 6, 2014 at 6:34 AM, Tom Zanussi tom.zanu...@linux.intel.com wrote: On Tue, 2014-05-06 at 09:25 +0200, Richard Weinberger wrote: On Tue, May 6, 2014 at 12:25 AM, Andi Kleen a...@firstfloor.org wrote: There has been a lot of interest recently to run Linux on very small systems,

Re: RFC: A reduced Linux network stack for small systems

2014-05-06 Thread Alexei Starovoitov
On Tue, May 6, 2014 at 8:34 AM, Tom Zanussi tom.zanu...@linux.intel.com wrote: On Tue, 2014-05-06 at 08:20 -0700, Alexei Starovoitov wrote: On Tue, May 6, 2014 at 6:34 AM, Tom Zanussi tom.zanu...@linux.intel.com wrote: On Tue, 2014-05-06 at 09:25 +0200, Richard Weinberger wrote: On Tue

Re: RFC: A reduced Linux network stack for small systems

2014-05-06 Thread Alexei Starovoitov
On Tue, May 6, 2014 at 1:00 PM, Andi Kleen a...@firstfloor.org wrote: not quite. I'm saying: no extra optimizations, no GCC changes. Compile kernel as-is. Most functions have a stub for mcount() already. Use it to track whether kernel function was called or not. Collect this data in userspace

fakeroot make-kpkg is broken in 3.14

2014-04-03 Thread Alexei Starovoitov
It seems commit f4d4ffc03efc (kbuild: dtbs_install: new make target) breaks 'fakeroot make-kpkg' package creation on ubuntu. Didn't investigate the root cause yet, just heads up. The errors I see: update-initramfs: Generating /w/net/debian/linux-image-3.14.0+//boot/initrd.img-3.14.0+ grep:

Re: ktap and ebpf integration

2014-04-04 Thread Alexei Starovoitov
On Thu, Apr 3, 2014 at 6:21 PM, Jovi Zhangwei jovi.zhang...@gmail.com wrote: Hi Alexei, We talked a lot on ktap and ebpf integration in these days, Now I think we can put into deeply to thinking out some technical issues in there. Firstly, I want to make sure you are support this ktap and

Re: ktap and ebpf integration

2014-04-04 Thread Alexei Starovoitov
On Fri, Apr 4, 2014 at 1:46 AM, Jovi Zhangwei jovi.zhang...@gmail.com wrote: On Fri, Apr 4, 2014 at 3:48 PM, Ingo Molnar mi...@kernel.org wrote: * Jovi Zhangwei jovi.zhang...@gmail.com wrote: On Fri, Apr 4, 2014 at 2:26 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Thu, Apr 3, 2014

Re: ktap and ebpf integration

2014-04-04 Thread Alexei Starovoitov
On Fri, Apr 4, 2014 at 7:20 AM, Andi Kleen a...@firstfloor.org wrote: BTW I agree that EBPF won't work for ktap. The models (static vs dynamic typing etc.) are just too different. If you meant 'static vs dynamic safety checking' then yes. This is a main difference between bpf and ktap approach

Re: [RFC PATCH] cmdline: Hide debug from /proc/cmdline

2014-04-04 Thread Alexei Starovoitov
On Fri, Apr 4, 2014 at 1:17 PM, Theodore Ts'o ty...@mit.edu wrote: On Fri, Apr 04, 2014 at 03:44:26PM -0400, Steven Rostedt wrote: I saw one commenter say that this was a kernel bug because writing to kmsg shouldn't cause the system to hang. The rate-limit patch would go along with that idea,

Re: ktap and ebpf integration

2014-04-05 Thread Alexei Starovoitov
On Sat, Apr 5, 2014 at 7:23 AM, Jovi Zhangwei jovi.zhang...@gmail.com wrote: On Sat, Apr 5, 2014 at 1:28 AM, Alexei Starovoitov a...@plumgrid.com wrote: 'ktap syntax' from user space point of view, can use ibpf as-is. Show me the script and I can show how ibpf can run it. Well, please don't

Re: fakeroot make-kpkg is broken in 3.14

2014-04-07 Thread Alexei Starovoitov
On Fri, Apr 4, 2014 at 8:27 AM, Jason Cooper ja...@lakedaemon.net wrote: Alexei, Thanks for the heads up. On Thu, Apr 03, 2014 at 03:12:38PM -0700, Alexei Starovoitov wrote: It seems commit f4d4ffc03efc (kbuild: dtbs_install: new make target) breaks 'fakeroot make-kpkg' package creation

[RFC] bpf tracing filters API proposal. Was: [RFC PATCH 00/28] ktap: A lightweight dynamic tracing tool for Linux

2014-04-08 Thread Alexei Starovoitov
On Tue, Apr 8, 2014 at 2:08 AM, Peter Zijlstra pet...@infradead.org wrote: On Tue, Apr 08, 2014 at 04:40:36PM +0900, Masami Hiramatsu wrote: (2014/04/07 22:55), Peter Zijlstra wrote: On Wed, Apr 02, 2014 at 09:42:03AM +0200, Ingo Molnar wrote: I'd suggest using C syntax instead initially,

Re: [PATCH] seccomp: fix populating a0-a5 syscall args in 32-bit x86 BPF

2014-04-15 Thread Alexei Starovoitov
On Mon, Apr 14, 2014 at 1:28 PM, Andy Lutomirski l...@amacapital.net wrote: On Mon, Apr 14, 2014 at 1:24 PM, David Miller da...@davemloft.net wrote: From: Andy Lutomirski l...@amacapital.net Date: Mon, 14 Apr 2014 13:13:45 -0700 I think this description is wrong. (unsigned long *) sd-args[1]

Re: [PATCH] seccomp: Release fp pointer when leaving from seccomp_attach_filter().

2014-04-14 Thread Alexei Starovoitov
On Mon, Apr 14, 2014 at 9:02 AM, Masami Ichikawa masami...@gmail.com wrote: kmemleak reported some memory leak as below. grrr. yes. sorry. unreferenced object 0x8800d6ea4000 (size 512): comm sshd, pid 278, jiffies 4294898315 (age 46.653s) hex dump (first 32 bytes): 21 00 00 00

Re: [PATCH] seccomp: fix memory leak on filter attach

2014-04-14 Thread Alexei Starovoitov
...@vger.kernel.org Acked-by: Alexei Starovoitov a...@plumgrid.com --- kernel/seccomp.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/seccomp.c b/kernel/seccomp.c index fd609bd9d6dd..2d7dcdfb7422 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c @@ -256,6 +256,7 @@ static long

Re: [PATCH] seccomp: fix memory leak on filter attach

2014-04-14 Thread Alexei Starovoitov
On Mon, Apr 14, 2014 at 10:26 AM, Kees Cook keesc...@chromium.org wrote: On Mon, Apr 14, 2014 at 10:17 AM, Alexei Starovoitov a...@plumgrid.com wrote: On Mon, Apr 14, 2014 at 10:11 AM, Kees Cook keesc...@chromium.org wrote: This sets the correct error code when final filter memory

Re: [RFC PATCH 00/28] ktap: A lightweight dynamic tracing tool for Linux

2014-03-31 Thread Alexei Starovoitov
On Mon, Mar 31, 2014 at 3:01 AM, Jovi Zhangwei jovi.zhang...@gmail.com wrote: Hi Ingo, On Mon, Mar 31, 2014 at 3:17 PM, Ingo Molnar mi...@kernel.org wrote: * Jovi Zhangwei jovi.zhang...@gmail.com wrote: Hi All, The following set of patches add ktap tracing tool. ktap is a new

Re: [RFC PATCH 00/28] ktap: A lightweight dynamic tracing tool for Linux

2014-04-01 Thread Alexei Starovoitov
On Mon, Mar 31, 2014 at 9:47 PM, Jovi Zhangwei jovi.zhang...@gmail.com wrote: Hi Alexei, On Tue, Apr 1, 2014 at 5:29 AM, Alexei Starovoitov a...@plumgrid.com wrote: On Mon, Mar 31, 2014 at 3:01 AM, Jovi Zhangwei jovi.zhang...@gmail.com wrote: Hi Ingo, On Mon, Mar 31, 2014 at 3:17 PM, Ingo

Re: [PATCH RFCv2] arm64: eBPF JIT compiler

2014-07-10 Thread Alexei Starovoitov
On Wed, Jul 9, 2014 at 3:00 PM, Will Deacon will.dea...@arm.com wrote: On Tue, Jul 08, 2014 at 08:06:53AM +0100, Zi Shen Lim wrote: 1. Implement remaining classes of eBPF instructions: ST|MEM, STX|XADD which currently do not have corresponding test cases in test_bpf. I can help out with

Re: [PATCH v2 net-next 0/2] split BPF out of core networking

2014-06-23 Thread Alexei Starovoitov
On Fri, Jun 20, 2014 at 9:44 AM, Chema Gonzalez ch...@google.com wrote: Model eBPF based on MIPS ISA? Ouch. That would be one ugly ISA that is not JITable on x64. Definitely I wasn't making my point clear: IMO if we're redesigning the BPF ISA, we should get a clean one (clean=something that

Re: 9da0763 kbuild: Use relative path ... Broke my IDE

2014-06-18 Thread Alexei Starovoitov
On Wed, Jun 18, 2014 at 11:00 AM, Boaz Harrosh open...@gmail.com wrote: Hi Sir Michal Below patch broke my stupid yet useful IDE tool. I use kdevelop. kdevelop now gets confused on warnings and errors because it now comes out as (for example): ../fs/ext4/fsync.c:63:3: error: implicit

Re: [PATCH] net: filter: fix upper BPF instruction limit

2014-06-18 Thread Alexei Starovoitov
: bd4cf0ed331a (net: filter: rework/optimize internal BPF interpreter's instruction set) Signed-off-by: Kees Cook keesc...@chromium.org Cc: sta...@vger.kernel.org # v3.15+ Acked-by: Alexei Starovoitov a...@plumgrid.com I wonder how did you catch this? :) Just code inspection or seccomp

Re: [PATCH] net: filter: fix upper BPF instruction limit

2014-06-18 Thread Alexei Starovoitov
On Wed, Jun 18, 2014 at 3:55 PM, Kees Cook keesc...@chromium.org wrote: On Wed, Jun 18, 2014 at 3:48 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Wed, Jun 18, 2014 at 3:34 PM, Kees Cook keesc...@chromium.org wrote: The original checks (via sk_chk_filter) for instruction count uses

Re: [PATCH 00/14] arm64: eBPF JIT compiler

2014-07-21 Thread Alexei Starovoitov
On Mon, Jul 21, 2014 at 2:16 AM, Will Deacon will.dea...@arm.com wrote: Hello, On Fri, Jul 18, 2014 at 07:28:06PM +0100, Zi Shen Lim wrote: This series implements eBPF JIT compiler for arm64. Please see [14/14] for change log. Patches [1-13/14] implement code generation functions. Patch

[PATCH RFC v3 net-next 0/3] eBPF examples in C

2014-07-21 Thread Alexei Starovoitov
is counting events, user space prints them. Patch 1/3 is a parser of .o file generated by LLVM. It looks for pre-defined ELF sections like 'license', 'maps', 'events' and loads bpf maps/programs via BPF syscall that I posted earlier. Alexei Starovoitov (3): samples: bpf: elf file loader

[PATCH RFC v3 net-next 3/3] samples: bpf: eBPF dropmon example in C

2014-07-21 Thread Alexei Starovoitov
and programs Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- samples/bpf/Makefile |6 -- samples/bpf/ex2_kern.c | 29 + samples/bpf/ex2_user.c | 28 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644

[PATCH RFC v3 net-next 2/3] samples: bpf: eBPF example in C

2014-07-21 Thread Alexei Starovoitov
-25476 [002] ..s3 5640.716272: __netif_receive_skb_core: skb 5d06300 dev b9e6000 Ctrl-C at any time, kernel will auto cleanup Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- samples/bpf/Makefile | 15 +-- samples/bpf/ex1_kern.c | 27 +++ samples

[PATCH RFC v3 net-next 1/3] samples: bpf: elf file loader

2014-07-21 Thread Alexei Starovoitov
simple .o parser and loader using BPF syscall. .o is a standard ELF generated by LLVM backend /* parses elf file compiled by llvm .c-.o * creates maps and stores FD into map_fd array * loads eBPF programs * returns zero on success */ int load_bpf_file(char *path); Signed-off-by: Alexei

[PATCH net-next 0/2] net: filter: split eBPF interpreter out of core networking

2014-07-23 Thread Alexei Starovoitov
for eBPF core pieces In the foreseeable future eBPF patches will be going through net-next, so put netdev as a primary mailing list [1] git://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf master Alexei Starovoitov (2): net: filter: split filter.c into two files bpf: update MAINTAINERS entry

[PATCH net-next 2/2] bpf: update MAINTAINERS entry

2014-07-23 Thread Alexei Starovoitov
Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- MAINTAINERS |7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 78215a5dea28..62bf15f6954f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1912,6 +1912,13 @@ S: Supported F: drivers/net

[PATCH net-next 1/2] net: filter: split filter.c into two files

2014-07-23 Thread Alexei Starovoitov
. The new + * internal format has been designed by PLUMgrid: + * + * Copyright (c) 2011 - 2014 PLUMgrid, http://plumgrid.com + * + * Authors: + * + * Jay Schulist jsch...@samba.org + * Alexei Starovoitov a...@plumgrid.com + * Daniel Borkmann dbork...@redhat.com + * + * This program

[PATCH RFC net-next 10/14] net: sock: allow eBPF programs to be attached to sockets

2014-06-27 Thread Alexei Starovoitov
program Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- arch/alpha/include/uapi/asm/socket.h |2 + arch/avr32/include/uapi/asm/socket.h |2 + arch/cris/include/uapi/asm/socket.h|2 + arch/frv/include/uapi/asm/socket.h |2 + arch/ia64/include/uapi/asm/socket.h

[PATCH RFC net-next 06/14] bpf: add hashtable type of BPF maps

2014-06-27 Thread Alexei Starovoitov
add new map type: BPF_MAP_TYPE_HASH and its simple (not auto resizeable) hash table implementation Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/uapi/linux/bpf.h |1 + kernel/bpf/Makefile |2 +- kernel/bpf/hashtab.c | 371

[PATCH RFC net-next 13/14] samples: bpf: example of stateful socket filtering

2014-06-27 Thread Alexei Starovoitov
(map_id, fp - 4); if (value) (*(u64*)value) += 1; - attaches this program to eth0 raw socket - every second user space reads map[6] and map[17] to see how many TCP and UDP packets were seen on eth0 Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- samples/bpf/.gitignore

[PATCH RFC net-next 01/14] net: filter: split filter.c into two files

2014-06-27 Thread Alexei Starovoitov
. The new + * internal format has been designed by PLUMgrid: + * + * Copyright (c) 2011 - 2014 PLUMgrid, http://plumgrid.com + * + * Authors: + * + * Jay Schulist jsch...@samba.org + * Alexei Starovoitov a...@plumgrid.com + * Daniel Borkmann dbork...@redhat.com + * + * This program

[PATCH RFC net-next 11/14] tracing: allow eBPF programs to be attached to events

2014-06-27 Thread Alexei Starovoitov
/delete elements in maps - memcmp - trace_printk - load_pointer - dump_stack Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/linux/ftrace_event.h |5 + include/trace/bpf_trace.h | 29 + include/trace/ftrace.h | 10 ++ include/uapi/linux/bpf.h

[PATCH RFC net-next 09/14] bpf: allow eBPF programs to use maps

2014-06-27 Thread Alexei Starovoitov
expose bpf_map_lookup_elem(), bpf_map_update_elem(), bpf_map_delete_elem() map accessors to eBPF programs Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/linux/bpf.h |5 +++ include/uapi/linux/bpf.h |3 ++ kernel/bpf/syscall.c | 85

[PATCH RFC net-next 14/14] samples: bpf: example of tracing filters with eBPF

2014-06-27 Thread Alexei Starovoitov
simple packet drop monitor: - in-kernel eBPF program attaches to kfree_skb() event and records number of packet drops at given location - userspace iterates over the map every second and prints stats Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- samples/bpf/Makefile |4

[PATCH RFC net-next 08/14] bpf: add eBPF verifier

2014-06-27 Thread Alexei Starovoitov
prototype More details in Documentation/networking/filter.txt Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- Documentation/networking/filter.txt | 233 ++ include/linux/bpf.h | 48 ++ include/uapi/linux/bpf.h|1 + kernel/bpf/Makefile

[PATCH RFC net-next 12/14] samples: bpf: add mini eBPF library to manipulate maps and programs

2014-06-27 Thread Alexei Starovoitov
); Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- samples/bpf/libbpf.c | 114 ++ samples/bpf/libbpf.h | 18 2 files changed, 132 insertions(+) create mode 100644 samples/bpf/libbpf.c create mode 100644 samples/bpf/libbpf.h diff

[PATCH RFC net-next 04/14] bpf: update MAINTAINERS entry

2014-06-27 Thread Alexei Starovoitov
Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- MAINTAINERS |9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 48f4ef44b252..ebd831cd1a25 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1881,6 +1881,15 @@ S: Supported F: drivers/net

[PATCH RFC net-next 03/14] bpf: introduce syscall(BPF, ...) and BPF maps

2014-06-27 Thread Alexei Starovoitov
in NET-less configurations. Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- Documentation/networking/filter.txt | 69 ++ arch/x86/syscalls/syscall_64.tbl|1 + include/linux/bpf.h | 44 +++ include/linux/syscalls.h|2 + include/uapi/asm

[PATCH RFC net-next 05/14] bpf: add lookup/update/delete/iterate methods to BPF maps

2014-06-27 Thread Alexei Starovoitov
(based on input key return next_key) err = bpf_map_get_next_key(int map_id, void *key, void *next_key) Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/linux/bpf.h |6 ++ include/uapi/linux/bpf.h | 25 +++ kernel/bpf/syscall.c | 180

[PATCH RFC net-next 00/14] BPF syscall, maps, verifier, samples

2014-06-27 Thread Alexei Starovoitov
://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf master for you to fetch changes up to 4c8da0f21220087e38894c69339cddc64c1220f9: samples: bpf: example of tracing filters with eBPF (2014-06-27 15:22:07 -0700) Alexei Starovoitov (14): net

[PATCH RFC net-next 02/14] net: filter: split filter.h and expose eBPF to user space

2014-06-27 Thread Alexei Starovoitov
cannot go into uapi/linux/filter.h, since the names may conflict with existing applications. Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/linux/filter.h| 294 +-- include/uapi/linux/Kbuild |1 + include/uapi/linux/bpf.h | 305

[PATCH RFC net-next 07/14] bpf: expand BPF syscall with program load/unload

2014-06-27 Thread Alexei Starovoitov
and LICENSE) TEXT - array of eBPF instructions LICENSE - GPL compatible - unload eBPF program err = bpf_prog_unload(int prog_id) User space example of syscall(__NR_bpf, BPF_PROG_LOAD, prog_id, prog_type, ...) follows in later patches Signed-off-by: Alexei Starovoitov a...@plumgrid.com

Re: [PATCH RFC net-next 03/14] bpf: introduce syscall(BPF, ...) and BPF maps

2014-06-27 Thread Alexei Starovoitov
On Fri, Jun 27, 2014 at 5:16 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 5:05 PM, Alexei Starovoitov a...@plumgrid.com wrote: BPF syscall is a demux for different BPF releated commands. 'maps' is a generic storage of different types for sharing data between kernel

Re: [PATCH RFC net-next 04/14] bpf: update MAINTAINERS entry

2014-06-28 Thread Alexei Starovoitov
On Fri, Jun 27, 2014 at 5:18 PM, Joe Perches j...@perches.com wrote: Add MAINTAINERS entry. On Fri, 2014-06-27 at 17:05 -0700, Alexei Starovoitov wrote: diff --git a/MAINTAINERS b/MAINTAINERS [] @@ -1881,6 +1881,15 @@ S: Supported F: drivers/net/bonding/ F: include/uapi/linux

Re: [PATCH RFC net-next 07/14] bpf: expand BPF syscall with program load/unload

2014-06-28 Thread Alexei Starovoitov
On Fri, Jun 27, 2014 at 5:19 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 5:05 PM, Alexei Starovoitov a...@plumgrid.com wrote: eBPF programs are safe run-to-completion functions with load/unload methods from userspace similar to kernel modules. User space API

Re: [PATCH RFC net-next 13/14] samples: bpf: example of stateful socket filtering

2014-06-28 Thread Alexei Starovoitov
On Fri, Jun 27, 2014 at 5:21 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 5:06 PM, Alexei Starovoitov a...@plumgrid.com wrote: this socket filter example does: - creates a hashtable in kernel with key 4 bytes and value 8 bytes - populates map[6] = 0; map[17] = 0

Re: [PATCH RFC net-next 03/14] bpf: introduce syscall(BPF, ...) and BPF maps

2014-06-28 Thread Alexei Starovoitov
On Fri, Jun 27, 2014 at 11:25 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 10:55 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Fri, Jun 27, 2014 at 5:16 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 5:05 PM, Alexei Starovoitov

Re: [PATCH RFC net-next 07/14] bpf: expand BPF syscall with program load/unload

2014-06-28 Thread Alexei Starovoitov
On Fri, Jun 27, 2014 at 11:28 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 11:12 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Fri, Jun 27, 2014 at 5:19 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 5:05 PM, Alexei Starovoitov

Re: [PATCH RFC net-next 08/14] bpf: add eBPF verifier

2014-06-28 Thread Alexei Starovoitov
On Sat, Jun 28, 2014 at 9:01 AM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 5:06 PM, Alexei Starovoitov a...@plumgrid.com wrote: Safety of eBPF programs is statically determined by the verifier, which detects: This is a very high-level review. I haven't tried to read

Re: [PATCH RFC net-next 03/14] bpf: introduce syscall(BPF, ...) and BPF maps

2014-06-28 Thread Alexei Starovoitov
On Sat, Jun 28, 2014 at 8:34 AM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 11:43 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Fri, Jun 27, 2014 at 11:25 PM, Andy Lutomirski l...@amacapital.net wrote: On Fri, Jun 27, 2014 at 10:55 PM, Alexei Starovoitov

Re: [PATCH RFC net-next 08/14] bpf: add eBPF verifier

2014-06-29 Thread Alexei Starovoitov
On Sat, Jun 28, 2014 at 6:58 PM, Andy Lutomirski l...@amacapital.net wrote: These were great questions! I hope I answered them. If not, please continue asking. I have plenty more questions, but here's one right now: does anything prevent programs from using pointers in comparisons, returning

Re: [PATCH RFC net-next 03/14] bpf: introduce syscall(BPF, ...) and BPF maps

2014-06-29 Thread Alexei Starovoitov
On Sat, Jun 28, 2014 at 6:52 PM, Andy Lutomirski l...@amacapital.net wrote: On Sat, Jun 28, 2014 at 1:49 PM, Alexei Starovoitov a...@plumgrid.com wrote: Sorry I don't like 'fd' direction at all. 1. it will make the whole thing very socket specific and 'net' dependent. but the goal here

Re: [PATCH RFC net-next 07/14] bpf: expand BPF syscall with program load/unload

2014-06-30 Thread Alexei Starovoitov
On Sat, Jun 28, 2014 at 8:35 AM, Andy Lutomirski l...@amacapital.net wrote: On Sat, Jun 28, 2014 at 8:21 AM, Greg KH gre...@linuxfoundation.org wrote: On Sat, Jun 28, 2014 at 12:26:14AM -0700, Alexei Starovoitov wrote: On Fri, Jun 27, 2014 at 11:28 PM, Andy Lutomirski l...@amacapital.net

Re: [PATCH RFC net-next 03/14] bpf: introduce syscall(BPF, ...) and BPF maps

2014-06-30 Thread Alexei Starovoitov
On Mon, Jun 30, 2014 at 3:09 PM, Andy Lutomirski l...@amacapital.net wrote: On Sat, Jun 28, 2014 at 11:36 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Sat, Jun 28, 2014 at 6:52 PM, Andy Lutomirski l...@amacapital.net wrote: On Sat, Jun 28, 2014 at 1:49 PM, Alexei Starovoitov

Re: [PATCH RFC net-next 03/14] bpf: introduce syscall(BPF, ...) and BPF maps

2014-07-05 Thread Alexei Starovoitov
On Fri, Jul 4, 2014 at 8:17 AM, Andy Lutomirski l...@amacapital.net wrote: On Wed, Jul 2, 2014 at 7:29 PM, Alexei Starovoitov a...@plumgrid.com wrote: non-root API: ufd = bpf_create_map(local_map_id,… ) bpf_map_update/delete/lookup_elem(ufd,…) ufd = bpf_prog_load(insns) close(ufd) root

Re: [RFC PATCH 00/11] Adding FreeBSD's Capsicum security framework (part 1)

2014-07-07 Thread Alexei Starovoitov
On Mon, Jul 7, 2014 at 5:20 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 07/07/2014 12:29, David Drysdale ha scritto: I think that's more easily done by opening the file as O_RDONLY/O_WRONLY /O_RDWR. You could do it by running the file descriptor's seccomp-bpf program once per iocb with

Re: [PATCH RFCv2] arm64: eBPF JIT compiler

2014-07-08 Thread Alexei Starovoitov
+ emit(A64_REV16(0, r0, r0), ctx); +#endif + break; + case BPF_B: + emit(A64_LDRB(r0, r5, A64_ZR), ctx); + break; + case BPF_DW: this case can be removed too. Acked-by: Alexei Starovoitov

Re: [PATCH RFC net-next 08/14] bpf: add eBPF verifier

2014-07-01 Thread Alexei Starovoitov
On Tue, Jul 1, 2014 at 1:05 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/28/2014 02:06 AM, Alexei Starovoitov wrote: Safety of eBPF programs is statically determined by the verifier, which detects: - loops - out of range jumps - unreachable instructions - invalid instructions

Re: [PATCH RFC net-next 11/14] tracing: allow eBPF programs to be attached to events

2014-07-01 Thread Alexei Starovoitov
On Tue, Jul 1, 2014 at 1:30 AM, Daniel Borkmann dbork...@redhat.com wrote: On 06/28/2014 02:06 AM, Alexei Starovoitov wrote: User interface: cat bpf_123 /sys/kernel/debug/tracing/__event__/filter where 123 is an id of the eBPF program priorly loaded. __event__ is static tracepoint event

Re: [PATCH RFC net-next 03/14] bpf: introduce syscall(BPF, ...) and BPF maps

2014-07-01 Thread Alexei Starovoitov
On Tue, Jul 1, 2014 at 8:11 AM, Andy Lutomirski l...@amacapital.net wrote: On Mon, Jun 30, 2014 at 10:47 PM, Alexei Starovoitov a...@plumgrid.com wrote: On Mon, Jun 30, 2014 at 3:09 PM, Andy Lutomirski l...@amacapital.net wrote: On Sat, Jun 28, 2014 at 11:36 PM, Alexei Starovoitov

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