linux-stable/net/xdp
Kal Conley b8f83d5ae1 xsk: Fix unaligned descriptor validation
[ Upstream commit d769ccaf95 ]

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: 2b43470add ("xsk: Introduce AF_XDP buffer allocation API")
Signed-off-by: Kal Conley <kal.conley@dectris.com>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/r/20230405235920.7305-2-kal.conley@dectris.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:17:16 +09:00
..
Kconfig
Makefile
xdp_umem.c xsk: Add missing overflow check in xdp_umem_reg 2023-03-16 16:02:55 +01:00
xdp_umem.h
xsk.c xsk: add linux/vmalloc.h to xsk.c 2023-02-21 09:00:09 -08:00
xsk.h
xsk_buff_pool.c xsk: add usage of XDP features flags 2023-02-02 20:48:23 -08:00
xsk_diag.c
xsk_queue.c xsk: support use vaddr as ring 2023-02-20 08:22:12 +00:00
xsk_queue.h xsk: Fix unaligned descriptor validation 2023-05-11 23:17:16 +09:00
xskmap.c bpf: return long from bpf_map_ops funcs 2023-05-11 23:17:13 +09:00