aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/global_data_init.c
diff options
context:
space:
mode:
authorHou Tao <[email protected]>2022-09-01 06:19:35 +0000
committerMartin KaFai Lau <[email protected]>2022-09-01 19:16:12 +0000
commit197827a05e13808c60f52632e9887eede63f1c16 (patch)
tree3557bd01bd7498389f9e04d93a03fcb9d44b6ba8 /tools/testing/selftests/bpf/prog_tests/global_data_init.c
parentMerge branch 'fixes for concurrent htab updates' (diff)
downloadkernel-197827a05e13808c60f52632e9887eede63f1c16.tar.gz
kernel-197827a05e13808c60f52632e9887eede63f1c16.zip
bpf: Use this_cpu_{inc|dec|inc_return} for bpf_task_storage_busy
Now migrate_disable() does not disable preemption and under some architectures (e.g. arm64) __this_cpu_{inc|dec|inc_return} are neither preemption-safe nor IRQ-safe, so for fully preemptible kernel concurrent lookups or updates on the same task local storage and on the same CPU may make bpf_task_storage_busy be imbalanced, and bpf_task_storage_trylock() on the specific cpu will always fail. Fixing it by using this_cpu_{inc|dec|inc_return} when manipulating bpf_task_storage_busy. Fixes: bc235cdb423a ("bpf: Prevent deadlock from recursive bpf_task_storage_[get|delete]") Signed-off-by: Hou Tao <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/global_data_init.c')
0 files changed, 0 insertions, 0 deletions