diff options
author | Mark Brown <broonie@kernel.org> | 2020-08-25 11:01:24 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-08-25 11:01:24 +0100 |
commit | afa86a047edef28004fb3d2a47d3d90309a830a5 (patch) | |
tree | 3c8c4df30900289e41de18db69e732535d1122e4 /kernel/bpf/task_iter.c | |
parent | aafdeba5cbc14cecee3797e669473b70a2b3e81e (diff) | |
parent | d012a7190fc1fd72ed48911e77ca97ba4521bccd (diff) |
Merge tag 'v5.9-rc2' into asoc-5.10
Linux 5.9-rc2
Diffstat (limited to 'kernel/bpf/task_iter.c')
-rw-r--r-- | kernel/bpf/task_iter.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c index 232df29793e96..99af4cea11025 100644 --- a/kernel/bpf/task_iter.c +++ b/kernel/bpf/task_iter.c @@ -29,8 +29,9 @@ static struct task_struct *task_seq_get_next(struct pid_namespace *ns, rcu_read_lock(); retry: - pid = idr_get_next(&ns->idr, tid); + pid = find_ge_pid(*tid, ns); if (pid) { + *tid = pid_nr_ns(pid, ns); task = get_pid_task(pid, PIDTYPE_PID); if (!task) { ++*tid; @@ -178,10 +179,11 @@ again: f = fcheck_files(curr_files, curr_fd); if (!f) continue; + if (!get_file_rcu(f)) + continue; /* set info->fd */ info->fd = curr_fd; - get_file(f); rcu_read_unlock(); return f; } |