diff options
author | Jesper Dangaard Brouer <brouer@redhat.com> | 2020-05-18 15:05:27 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-05-19 17:56:34 +0200 |
commit | d800bad67d4c21aaf11722f04e0f7547fb915ab5 (patch) | |
tree | e7dbca49e7a5c1b6a8c5bd42acec8624903914df /COPYING | |
parent | 59929cd1fec508a48ea2a04d8f2e4fdef907a2cd (diff) |
bpf: Fix too large copy from user in bpf_test_init
Commit bc56c919fce7 ("bpf: Add xdp.frame_sz in bpf_prog_test_run_xdp().")
recently changed bpf_prog_test_run_xdp() to use larger frames for XDP in
order to test tail growing frames (via bpf_xdp_adjust_tail) and to have
memory backing frame better resemble drivers.
The commit contains a bug, as it tries to copy the max data size from
userspace, instead of the size provided by userspace. This cause XDP
unit tests to fail sporadically with EFAULT, an unfortunate behavior.
The fix is to only copy the size specified by userspace.
Fixes: bc56c919fce7 ("bpf: Add xdp.frame_sz in bpf_prog_test_run_xdp().")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/158980712729.256597.6115007718472928659.stgit@firesoul
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions