]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix possible race in inc_misses_counter
authorHe Fengqing <hefengqing@huawei.com>
Sat, 22 Jan 2022 10:29:36 +0000 (10:29 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 26 Jan 2022 01:50:03 +0000 (17:50 -0800)
commit2cfd634950234ff126ba0561c00374059585ea11
tree3677f5921a1e98e432e54135287577bcc37d8c87
parentca8c76610f18de6336076e04ca097ba627cfd9fd
bpf: Fix possible race in inc_misses_counter

It seems inc_misses_counter() suffers from same issue fixed in
the commit 0aff865ed634 ("bpf: Fixes possible race in update_prog_stats()
for 32bit arches"):
As it can run while interrupts are enabled, it could
be re-entered and the u64_stats syncp could be mangled.

Fixes: 8343ae565751 ("bpf: Count the number of times recursion was prevented")
Signed-off-by: He Fengqing <hefengqing@huawei.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20220122102936.1219518-1-hefengqing@huawei.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/trampoline.c