]> www.infradead.org Git - users/dwmw2/linux.git/commit
netfilter: nft_set_pipapo_avx2: disable softinterrupts
authorFlorian Westphal <fw@strlen.de>
Fri, 19 Jul 2024 11:19:26 +0000 (13:19 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 24 Jul 2024 08:01:59 +0000 (10:01 +0200)
commita16909ae9982e931841c456061cb57fbaec9c59e
tree3dfa295598ab5b7631e33f68d0c0b37c8c7ca30b
parent3ba359c0cd6eb5ea772125a7aededb4a2d516684
netfilter: nft_set_pipapo_avx2: disable softinterrupts

We need to disable softinterrupts, else we get following problem:

1. pipapo_avx2 called from process context; fpu usable
2. preempt_disable() called, pcpu scratchmap in use
3. softirq handles rx or tx, we re-enter pipapo_avx2
4. fpu busy, fallback to generic non-avx version
5. fallback reuses scratch map and index, which are in use
   by the preempted process

Handle this same way as generic version by first disabling
softinterrupts while the scratchmap is in use.

Fixes: f0b3d338064e ("netfilter: nft_set_pipapo_avx2: Add irq_fpu_usable() check, fallback to non-AVX2 version")
Cc: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_set_pipapo_avx2.c