Re: [PATCH 0/3] Fix unsafe BPF_PROG_TEST_RUN interface

2018-11-19 Thread Daniel Borkmann
On 11/19/2018 03:30 PM, Lorenz Bauer wrote: > On Sun, 18 Nov 2018 at 06:13, Y Song wrote: >> >> There is a slight change of user space behavior for this patch. >> Without this patch, the value bpf_attr.test.data_size_out is output only. >> For example, >>output buffer : out_buf (user allocated

Re: [PATCH 0/3] Fix unsafe BPF_PROG_TEST_RUN interface

2018-11-19 Thread Lorenz Bauer
On Sun, 18 Nov 2018 at 06:13, Y Song wrote: > > There is a slight change of user space behavior for this patch. > Without this patch, the value bpf_attr.test.data_size_out is output only. > For example, >output buffer : out_buf (user allocated size 10) >data_size_out is a random value (e.g

Re: [PATCH 0/3] Fix unsafe BPF_PROG_TEST_RUN interface

2018-11-17 Thread Y Song
On Fri, Nov 16, 2018 at 12:54 PM Lorenz Bauer wrote: > > Right now, there is no safe way to use BPF_PROG_TEST_RUN with data_out. > This is because bpf_test_finish copies the output buffer to user space > without checking its size. This can lead to the kernel overwriting > data in user space after

[PATCH 0/3] Fix unsafe BPF_PROG_TEST_RUN interface

2018-11-16 Thread Lorenz Bauer
Right now, there is no safe way to use BPF_PROG_TEST_RUN with data_out. This is because bpf_test_finish copies the output buffer to user space without checking its size. This can lead to the kernel overwriting data in user space after the buffer if xdp_adjust_head and friends are in play. Fix this