WSL2-Linux-Kernel/net/xdp
Kal Conley 119f278ea9 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:00:27 +09:00
..
Kconfig
Makefile
xdp_umem.c xsk: Add missing overflow check in xdp_umem_reg 2023-03-30 12:47:44 +02:00
xdp_umem.h
xsk.c xsk: Fix backpressure mechanism on Tx 2022-10-26 12:34:40 +02:00
xsk.h xdp: Add proper __rcu annotations to redirect map entries 2021-06-24 19:41:15 +02:00
xsk_buff_pool.c xsk: Inherit need_wakeup flag for shared sockets 2022-10-12 09:53:26 +02:00
xsk_diag.c
xsk_queue.c
xsk_queue.h xsk: Fix unaligned descriptor validation 2023-05-11 23:00:27 +09:00
xskmap.c xdp: Add proper __rcu annotations to redirect map entries 2021-06-24 19:41:15 +02:00