Skip to content

Commit 850610d

Browse files
committed
Merge: nft_concat_range: fix incorrect avx2 match
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6736 JIRA: https://issues.redhat.com/browse/RHEL-87163 * e042ed9 nft_set_pipapo: fix incorrect avx2 match of 5th field octet * 27eb86e selftests: netfilter: add test case for recent mismatch bug Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2025-04-14 07:31 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small> Approved-by: Phil Sutter <psutter@redhat.com> Approved-by: Eric Garver <egarver@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents cc1d4ec + 31b8f30 commit 850610d

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

net/netfilter/nft_set_pipapo_avx2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,8 +994,9 @@ static int nft_pipapo_avx2_lookup_8b_16(unsigned long *map, unsigned long *fill,
994994
NFT_PIPAPO_AVX2_BUCKET_LOAD8(5, lt, 8, pkt[8], bsize);
995995

996996
NFT_PIPAPO_AVX2_AND(6, 2, 3);
997+
NFT_PIPAPO_AVX2_AND(3, 4, 7);
997998
NFT_PIPAPO_AVX2_BUCKET_LOAD8(7, lt, 9, pkt[9], bsize);
998-
NFT_PIPAPO_AVX2_AND(0, 4, 5);
999+
NFT_PIPAPO_AVX2_AND(0, 3, 5);
9991000
NFT_PIPAPO_AVX2_BUCKET_LOAD8(1, lt, 10, pkt[10], bsize);
10001001
NFT_PIPAPO_AVX2_AND(2, 6, 7);
10011002
NFT_PIPAPO_AVX2_BUCKET_LOAD8(3, lt, 11, pkt[11], bsize);

tools/testing/selftests/net/netfilter/nft_concat_range.sh

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TYPES="net_port port_net net6_port port_proto net6_port_mac net6_port_mac_proto
2727
net6_port_net6_port net_port_mac_proto_net"
2828

2929
# Reported bugs, also described by TYPE_ variables below
30-
BUGS="flush_remove_add reload net_port_proto_match"
30+
BUGS="flush_remove_add reload net_port_proto_match avx2_mismatch"
3131

3232
# List of possible paths to pktgen script from kernel tree for performance tests
3333
PKTGEN_SCRIPT_PATHS="
@@ -387,6 +387,25 @@ race_repeat 0
387387
388388
perf_duration 0
389389
"
390+
391+
TYPE_avx2_mismatch="
392+
display avx2 false match
393+
type_spec inet_proto . ipv6_addr
394+
chain_spec meta l4proto . ip6 daddr
395+
dst proto addr6
396+
src
397+
start 1
398+
count 1
399+
src_delta 1
400+
tools ping
401+
proto icmp6
402+
403+
race_repeat 0
404+
405+
perf_duration 0
406+
"
407+
408+
390409
# Set template for all tests, types and rules are filled in depending on test
391410
set_template='
392411
flush ruleset
@@ -1629,6 +1648,24 @@ test_bug_net_port_proto_match() {
16291648
nft flush ruleset
16301649
}
16311650

1651+
test_bug_avx2_mismatch()
1652+
{
1653+
setup veth send_"${proto}" set || return ${ksft_skip}
1654+
1655+
local a1="fe80:dead:01ff:0a02:0b03:6007:8009:a001"
1656+
local a2="fe80:dead:01fe:0a02:0b03:6007:8009:a001"
1657+
1658+
nft "add element inet filter test { icmpv6 . $a1 }"
1659+
1660+
dst_addr6="$a2"
1661+
send_icmp6
1662+
1663+
if [ "$(count_packets)" -gt "0" ]; then
1664+
err "False match for $a2"
1665+
return 1
1666+
fi
1667+
}
1668+
16321669
test_reported_issues() {
16331670
eval test_bug_"${subtest}"
16341671
}

0 commit comments

Comments
 (0)