Skip to content

netfilter: nf_set_pipapo_avx2: fix initial map fill

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3netfilter: nf_set_pipapo_avx2: fix initial map fillnet/netfilter/nft_set_pipapo_avx2.c+20 -12 replies
2/3selftests: netfilter: nft_concat_range.sh: prefer per element counters for testingtools/testing/selftests/net/netfilter/nft_concat_range.sh+30 -100 replies
3/3selftests: netfilter: nft_concat_range.sh: add datapath check for map fill bugtools/testing/selftests/net/netfilter/nft_concat_range.sh+58 -40 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchStefano Brivio
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH nf-next 0/3] netfilter: nf_set_pipapo_avx2: fix initial map fill

The avx2 implementation suffers from the same bug fixed in the C implementation with 791a615b7ad2
("netfilter: nf_set_pipapo: fix initial map fill").

If the first field isn't the largest one, there will be mismatches, i.e. a wrong match will be returned.

First patch fixes this bug.

Because the selftest data path test does:
.... @test counter name ...

.. and then checks if the counter has been incremented, the selftest first needs to be reworked to use per-element counters.

Otherwise, we can only differentiate between 'no entry matches' and 'some entry matches', but its imperative we can also validate that the lookup did return the correct element.

The second patch does reworks the selftest accordingly.

Last patch adds extends the existing regression test for this bug class by also validating the datapath, rather than just the control plane.

Florian Westphal (3):
netfilter: nf_set_pipapo_avx2: fix initial map fill
selftests: netfilter: nft_concat_range.sh: prefer per element counters
for testing
selftests: netfilter: nft_concat_range.sh: add datapath check for map
fill bug

 net/netfilter/nft_set_pipapo_avx2.c           |  21 +++-
 .../net/netfilter/nft_concat_range.sh         | 102 +++++++++++++++---
 2 files changed, 108 insertions(+), 15 deletions(-)
Signature · 1 line
2.49.0