[PATCH 6.12,6.6,6.1,5.15,5.10] netfilter: nft_set_pipapo_avx2: add missing vzeroupper

Eric Biggers <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.stable,gmane.comp.security.firewalls.netfilter.devel
Message-ID <[email protected]>
commit 55dd20f0f4b1be5c9c8a0275d8d763c86563eac2 upstream.

Since pipapo_get_avx2() uses YMM registers, execute vzeroupper before
returning from it.  This is needed to avoid degrading the performance of
any later SSE code that may happen to be executed.

Fixes: 7400b063969b ("nft_set_pipapo: Introduce AVX2-based lookup implementation")
Cc: [email protected]
Signed-off-by: Eric Biggers <[email protected]>
Reviewed-by: Stefano Brivio <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
---
 net/netfilter/nft_set_pipapo_avx2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nft_set_pipapo_avx2.c b/net/netfilter/nft_set_pipapo_avx2.c
index 9d5ada57aa6f..fd998af98922 100644
--- a/net/netfilter/nft_set_pipapo_avx2.c
+++ b/net/netfilter/nft_set_pipapo_avx2.c
@@ -1262,6 +1262,7 @@ nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
 out:
 	if (i % 2)
 		scratch->map_index = !map_index;
+	asm volatile("vzeroupper");
 	kernel_fpu_end();
 	local_bh_enable();
 

base-commit: f717995cb7dcd8998ab15516b8006aea09cfde0d
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.