Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2018-01-22 Thread Arnaldo Carvalho de Melo
Em Mon, Jan 22, 2018 at 10:28:11AM -0800, Yonghong Song escreveu: > The compiler did "40: (bf) r1 = r0" and then uses "r1" for branch > comparison, the original "r0" is left with complete unknown integer value > and later used to calculate the buffer size "55: (bf) r5 = r0" > where "r5" could be

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2018-01-22 Thread Yonghong Song
On 1/22/18 7:06 AM, Arnaldo Carvalho de Melo wrote: Em Wed, Nov 22, 2017 at 10:42:22AM -0800, Gianluca Borello escreveu: On Tue, Nov 21, 2017 at 2:31 PM, Alexei Starovoitov wrote: yeah sorry about this hack. Gianluca reported this issue as well. Yonghong fixed

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2018-01-22 Thread Arnaldo Carvalho de Melo
Em Wed, Nov 22, 2017 at 10:42:22AM -0800, Gianluca Borello escreveu: > On Tue, Nov 21, 2017 at 2:31 PM, Alexei Starovoitov > wrote: > > > > yeah sorry about this hack. Gianluca reported this issue as well. > > Yonghong fixed it for bpf_probe_read only. We will extend

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-22 Thread Gianluca Borello
On Tue, Nov 21, 2017 at 2:31 PM, Alexei Starovoitov wrote: > > yeah sorry about this hack. Gianluca reported this issue as well. > Yonghong fixed it for bpf_probe_read only. We will extend > the fix to bpf_probe_read_str() and bpf_perf_event_output() asap. > The

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-21 Thread Alexei Starovoitov
On Tue, Nov 21, 2017 at 11:29:05AM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Nov 14, 2017 at 02:58:24PM -0800, Yonghong Song escreveu: > > On 11/14/17 12:25 PM, Daniel Borkmann wrote: > > > Yeah, I know, that's what I mentioned earlier in this thread to resolve > > > it, > > > but do we

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-21 Thread Arnaldo Carvalho de Melo
Em Tue, Nov 14, 2017 at 02:58:24PM -0800, Yonghong Song escreveu: > On 11/14/17 12:25 PM, Daniel Borkmann wrote: > > Yeah, I know, that's what I mentioned earlier in this thread to resolve it, > > but do we really want to add this hack everywhere? :( Potentially any > > function > > having

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-20 Thread Yonghong Song
On 11/20/17 5:31 AM, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 14, 2017 at 09:25:17PM +0100, Daniel Borkmann escreveu: On 11/14/2017 07:15 PM, Yonghong Song wrote: On 11/14/17 6:19 AM, Daniel Borkmann wrote: On 11/14/2017 02:42 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 14, 2017 at

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-20 Thread Arnaldo Carvalho de Melo
Em Tue, Nov 14, 2017 at 09:25:17PM +0100, Daniel Borkmann escreveu: > On 11/14/2017 07:15 PM, Yonghong Song wrote: > > On 11/14/17 6:19 AM, Daniel Borkmann wrote: > >> On 11/14/2017 02:42 PM, Arnaldo Carvalho de Melo wrote: > >>> Em Tue, Nov 14, 2017 at 02:09:34PM +0100, Daniel Borkmann escreveu:

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-14 Thread Yonghong Song
On 11/14/17 12:25 PM, Daniel Borkmann wrote: On 11/14/2017 07:15 PM, Yonghong Song wrote: On 11/14/17 6:19 AM, Daniel Borkmann wrote: On 11/14/2017 02:42 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 14, 2017 at 02:09:34PM +0100, Daniel Borkmann escreveu: On 11/14/2017 01:58 PM, Arnaldo

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-14 Thread Daniel Borkmann
On 11/14/2017 07:15 PM, Yonghong Song wrote: > On 11/14/17 6:19 AM, Daniel Borkmann wrote: >> On 11/14/2017 02:42 PM, Arnaldo Carvalho de Melo wrote: >>> Em Tue, Nov 14, 2017 at 02:09:34PM +0100, Daniel Borkmann escreveu: On 11/14/2017 01:58 PM, Arnaldo Carvalho de Melo wrote: > Em Tue,

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-14 Thread Yonghong Song
On 11/14/17 6:19 AM, Daniel Borkmann wrote: On 11/14/2017 02:42 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 14, 2017 at 02:09:34PM +0100, Daniel Borkmann escreveu: On 11/14/2017 01:58 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 14, 2017 at 01:09:39AM +0100, Daniel Borkmann escreveu:

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-14 Thread Arnaldo Carvalho de Melo
Em Tue, Nov 14, 2017 at 03:19:51PM +0100, Daniel Borkmann escreveu: > On 11/14/2017 02:42 PM, Arnaldo Carvalho de Melo wrote: > > Em Tue, Nov 14, 2017 at 02:09:34PM +0100, Daniel Borkmann escreveu: > >> On 11/14/2017 01:58 PM, Arnaldo Carvalho de Melo wrote: > >> Currently having a version

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-14 Thread Daniel Borkmann
On 11/14/2017 02:42 PM, Arnaldo Carvalho de Melo wrote: > Em Tue, Nov 14, 2017 at 02:09:34PM +0100, Daniel Borkmann escreveu: >> On 11/14/2017 01:58 PM, Arnaldo Carvalho de Melo wrote: >>> Em Tue, Nov 14, 2017 at 01:09:39AM +0100, Daniel Borkmann escreveu: On 11/13/2017 04:08 PM, Arnaldo

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-14 Thread Arnaldo Carvalho de Melo
Em Tue, Nov 14, 2017 at 02:09:34PM +0100, Daniel Borkmann escreveu: > On 11/14/2017 01:58 PM, Arnaldo Carvalho de Melo wrote: > > Em Tue, Nov 14, 2017 at 01:09:39AM +0100, Daniel Borkmann escreveu: > >> On 11/13/2017 04:08 PM, Arnaldo Carvalho de Melo wrote: > >>> libbpf: -- BEGIN DUMP LOG --- >

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-14 Thread Daniel Borkmann
On 11/14/2017 01:58 PM, Arnaldo Carvalho de Melo wrote: > Em Tue, Nov 14, 2017 at 01:09:39AM +0100, Daniel Borkmann escreveu: >> On 11/13/2017 04:08 PM, Arnaldo Carvalho de Melo wrote: >>> libbpf: -- BEGIN DUMP LOG --- >>> libbpf: >>> 0: (79) r3 = *(u64 *)(r1 +104) >>> 1: (b7) r2 = 0 >>> 2: (bf)

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-14 Thread Arnaldo Carvalho de Melo
Em Tue, Nov 14, 2017 at 01:09:39AM +0100, Daniel Borkmann escreveu: > On 11/13/2017 04:08 PM, Arnaldo Carvalho de Melo wrote: > > libbpf: -- BEGIN DUMP LOG --- > > libbpf: > > 0: (79) r3 = *(u64 *)(r1 +104) > > 1: (b7) r2 = 0 > > 2: (bf) r6 = r1 > > 3: (bf) r1 = r10 > > 4: (07) r1 += -128 > > 5:

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-13 Thread Daniel Borkmann
On 11/13/2017 04:08 PM, Arnaldo Carvalho de Melo wrote: > Em Mon, Nov 13, 2017 at 03:56:14PM +0100, Daniel Borkmann escreveu: >> On 11/13/2017 03:30 PM, Arnaldo Carvalho de Melo wrote: >>> Hi, >>> >>> In a5e8c07059d0 ("bpf: add bpf_probe_read_str helper") you >>> state: >>> >>>"This is

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-13 Thread Arnaldo Carvalho de Melo
Em Mon, Nov 13, 2017 at 03:56:14PM +0100, Daniel Borkmann escreveu: > On 11/13/2017 03:30 PM, Arnaldo Carvalho de Melo wrote: > > Hi, > > > > In a5e8c07059d0 ("bpf: add bpf_probe_read_str helper") you > > state: > > > >"This is suboptimal because the size of the string needs to be

Re: len = bpf_probe_read_str(); bpf_perf_event_output(... len) == FAIL

2017-11-13 Thread Daniel Borkmann
On 11/13/2017 03:30 PM, Arnaldo Carvalho de Melo wrote: > Hi, > > In a5e8c07059d0 ("bpf: add bpf_probe_read_str helper") you > state: > >"This is suboptimal because the size of the string needs to be estimated > at compile time, causing more memory to be copied than often