bpf: Fix bpf_xdp_event_output
Subsystems (4)
PATCH 1/1 bpf: Fix bpf_xdp_event_output
Fix a typo. xdp->data instead of xdp should be copied to the perf-event's dst_buff.
Fixes 4de16969523c ("bpf: enable event output helper also for xdp types")
Reported-by Huapeng Zhou <[email protected]>
Tested-by Feixiong Zhang <[email protected]>
Cc Daniel Borkmann <[email protected]>
Signed-off-by Martin KaFai Lau <[email protected]>
--- net/core/filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/filter.c +2 -2
@@ -2584,8 +2584,8 @@ BPF_CALL_5(bpf_xdp_event_output, struct xdp_buff *, xdp, struct bpf_map *, map,if (unlikely (xdp_size > (unsigned long )(xdp->data_end - xdp->data)))return -EFAULT ; -return bpf_event_output (map, flags, meta, meta_size, xdp, xdp_size, - bpf_xdp_copy); +return bpf_event_output (map, flags, meta, meta_size, xdp->data, + xdp_size, bpf_xdp_copy); }static const struct bpf_func_proto bpf_xdp_event_output_proto = {
Signature · 1 line
2.5.1
Quoted 9 lines · Martin KaFai Lau
Fix a typo.
xdp->datainstead of xdp should be copied to the perf-event'sdst_buff.Fixes 4de16969523c ("bpf: enable event output helper also for xdp types")Reported-by Huapeng Zhou <[email protected]>Tested-by Feixiong Zhang <[email protected]>Cc Daniel Borkmann <[email protected]>Signed-off-by Martin KaFai Lau <[email protected]>
Acked-by Daniel Borkmann <[email protected]>
Thanks!
From: Martin KaFai Lau <[email protected]>
Date: Thu, 23 Feb 2017 10:40:34 -0800
Quoted 9 lines
Fix a typo.
xdp->datainstead of xdp should be copied to the perf-event'sdst_buff.Fixes 4de16969523c ("bpf: enable event output helper also for xdp types")Reported-by Huapeng Zhou <[email protected]>Tested-by Feixiong Zhang <[email protected]>Cc Daniel Borkmann <[email protected]>Signed-off-by Martin KaFai Lau <[email protected]>
Applied, thanks.