Skip to content
Commit 5a34f9da authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Alexei Starovoitov
Browse files

bpf: bpf_iter_task_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.

bpf_iter_task_next() can loop forever, "kit->pos == kit->task" can never
happen if kit->pos execs. Change this code to use __next_thread().

With or without this change the usage of kit->pos/task and next_task()
doesn't look nice, see the next patch.

Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarYonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231114163237.GA897@redhat.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 2d161805
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment