Kal Conley d769ccaf95 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 <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>
2023-04-06 09:53:05 -07:00
..
2023-01-12 17:02:20 -06:00
2023-02-21 18:24:12 -08:00
2023-02-13 09:30:14 +00:00
2023-02-21 18:24:12 -08:00
2023-02-22 14:47:20 -08:00
2023-02-21 18:24:12 -08:00
2023-02-21 18:24:12 -08:00
2023-03-08 13:21:47 +00:00
2023-02-21 18:24:12 -08:00
2023-02-10 17:51:27 -08:00
2022-08-22 14:26:30 +01:00
2023-02-21 18:24:12 -08:00