aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorKal Conley <[email protected]>2023-04-05 23:59:18 +0000
committerMartin KaFai Lau <[email protected]>2023-04-06 16:53:05 +0000
commitd769ccaf957fe7391f357c0a923de71f594b8a2b (patch)
tree04219cbe7264763a0b64b51f1db796069fbf7386 /tools/bpf/bpftool/prog.c
parentkallsyms: move module-related functions under correct configs (diff)
downloadkernel-d769ccaf957fe7391f357c0a923de71f594b8a2b.tar.gz
kernel-d769ccaf957fe7391f357c0a923de71f594b8a2b.zip
xsk: Fix unaligned descriptor validation
Make sure unaligned descriptors that straddle the end of the UMEM are considered invalid. Currently, descriptor validation is broken for zero-copy mode which only checks descriptors at page granularity. For example, descriptors in zero-copy mode that overrun the end of the UMEM but not a page boundary are (incorrectly) considered valid. The UMEM boundary check needs to happen before the page boundary and contiguity checks in xp_desc_crosses_non_contig_pg(). Do this check in xp_unaligned_validate_desc() instead like xp_check_unaligned() already does. Fixes: 2b43470add8c ("xsk: Introduce AF_XDP buffer allocation API") Signed-off-by: Kal Conley <[email protected]> Acked-by: Magnus Karlsson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions