bpf: Fixes possible race in update_prog_stats() for 32bit arches
authorEric Dumazet <edumazet@google.com>
Tue, 26 Oct 2021 21:41:32 +0000 (14:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:42 +0000 (19:16 +0100)
commit677c9ad9839ced509be7a91cbff4cb7027a9f8de
treec17f21c06f69ec0c99789f0b1adbe924e40a7d62
parentae1fffdf3b95d7ef2dbcc5aeab80db2a2ce06cb5
bpf: Fixes possible race in update_prog_stats() for 32bit arches

[ Upstream commit d979617aa84d96acca44c2f5778892b4565e322f ]

It seems update_prog_stats() suffers from same issue fixed
in the prior patch:

As it can run while interrupts are enabled, it could
be re-entered and the u64_stats syncp could be mangled.

Fixes: fec56f5890d9 ("bpf: Introduce BPF trampoline")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211026214133.3114279-3-eric.dumazet@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/bpf/trampoline.c