acrn-kernel/net/xdp
Kal Conley 3ee343914c 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:03:21 +09:00
..
Kconfig
Makefile
xdp_umem.c xsk: Add missing overflow check in xdp_umem_reg 2023-03-30 12:49:02 +02:00
xdp_umem.h
xsk.c
xsk.h
xsk_buff_pool.c
xsk_diag.c
xsk_queue.c
xsk_queue.h xsk: Fix unaligned descriptor validation 2023-05-11 23:03:21 +09:00
xskmap.c