]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: respect size hint to BPF_PROG_TEST_RUN if present
authorLorenz Bauer <lmb@cloudflare.com>
Mon, 3 Dec 2018 11:31:23 +0000 (11:31 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 4 Dec 2018 16:18:13 +0000 (08:18 -0800)
commite965e99227e6cbbeb2b2a86c52d7f631d67edfc2
tree979d2a28beaa2dcb3bba77964e7e44630694e8eb
parent79e1b4bbf989a4b4726f1ce3de14160cbfb5d033
bpf: respect size hint to BPF_PROG_TEST_RUN if present

Use data_size_out as a size hint when copying test output to user space.
ENOSPC is returned if the output buffer is too small.
Callers which so far did not set data_size_out are not affected.

Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/uapi/linux/bpf.h
net/bpf/test_run.c