Skip to content

Commit

Permalink
bpf: task_group_seq_get_next: fix the skip_if_dup_files check
Browse files Browse the repository at this point in the history
Unless I am notally confused it is wrong. We are going to return or
skip next_task so we need to check next_task-files, not task->files.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230905154651.GA24940@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Oleg Nesterov authored and Alexei Starovoitov committed Sep 8, 2023
1 parent 4981921 commit 87abbf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/bpf/task_iter.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static struct task_struct *task_group_seq_get_next(struct bpf_iter_seq_task_comm

common->pid_visiting = *tid;

if (skip_if_dup_files && task->files == task->group_leader->files) {
if (skip_if_dup_files && next_task->files == next_task->group_leader->files) {
task = next_task;
goto retry;
}
Expand Down

0 comments on commit 87abbf7

Please sign in to comment.