]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nft_set_pipapo: fix incorrect avx2 match of 5th field octet
authorFlorian Westphal <fw@strlen.de>
Mon, 7 Apr 2025 17:40:18 +0000 (19:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:09 +0000 (10:45 +0200)
commit90cdd7e5a4848e5a838742d69dc44f22db0e0888
tree9aa1a51101ba9fe9f6c095c9fcf39c5b6da11d4c
parentfbaffe8bccf148ece8ad67eb5d7aa852cabf59c8
nft_set_pipapo: fix incorrect avx2 match of 5th field octet

[ Upstream commit e042ed950d4e176379ba4c0722146cd96fb38aa2 ]

Given a set element like:

icmpv6 . dead:beef:00ff::1

The value of 'ff' is irrelevant, any address will be matched
as long as the other octets are the same.

This is because of too-early register clobbering:
ymm7 is reloaded with new packet data (pkt[9])  but it still holds data
of an earlier load that wasn't processed yet.

The existing tests in nft_concat_range.sh selftests do exercise this code
path, but do not trigger incorrect matching due to the network prefix
limitation.

Fixes: 7400b063969b ("nft_set_pipapo: Introduce AVX2-based lookup implementation")
Reported-by: sontu mazumdar <sontu21@gmail.com>
Closes: https://lore.kernel.org/netfilter/CANgxkqwnMH7fXra+VUfODT-8+qFLgskq3set1cAzqqJaV4iEZg@mail.gmail.com/T/#t
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_set_pipapo_avx2.c