On Mon, May 18, 2020 at 6:08 AM Jesper Dangaard Brouer <brouer@xxxxxxxxxx> wrote: > > 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@xxxxxxxxxx> > --- LGTM. Acked-by: Andrii Nakryiko <andriin@xxxxxx> > net/bpf/test_run.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > [...]