diff options
author | Oleg Nesterov <[email protected]> | 2023-11-14 17:32:34 +0100 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2023-11-19 11:43:44 -0800 |
commit | 2d1618054f25e11c44d189dbff4a60342a4cfb4b (patch) | |
tree | f801475761d64aa6bdaed25a183a7cc23efbce55 /tools/testing/selftests/bpf/progs/test_autoload.c | |
parent | 16b3129e14bf2e7505512568b11c437c840a0c19 (diff) |
bpf: task_group_seq_get_next: use __next_thread() rather than next_thread()
Lockless use of next_thread() should be avoided, kernel/bpf/task_iter.c
is the last user and the usage is wrong.
task_group_seq_get_next() can return the group leader twice if it races
with mt-thread exec which changes the group->leader's pid.
Change the main loop to use __next_thread(), kill "next_tid == common->pid"
check.
__next_thread() can't loop forever, we can also change this code to retry
if next_tid == 0.
Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions