aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/iters_task.c
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2024-03-13 08:43:21 +0000
committerThomas Zimmermann <[email protected]>2024-03-13 08:43:21 +0000
commita2e7496b453eaa577425858d6f8b854800ed7343 (patch)
tree35d05023d51161a28768a29115c8e03e65599fe5 /tools/testing/selftests/bpf/progs/iters_task.c
parentnouveau/dmem: handle kcalloc() allocation failure (diff)
parentnouveau: lock the client object tree. (diff)
downloadkernel-a2e7496b453eaa577425858d6f8b854800ed7343.tar.gz
kernel-a2e7496b453eaa577425858d6f8b854800ed7343.zip
Merge drm/drm-fixes into drm-misc-fixes
Backmerging to sync before merging the patchset at [1]. [1] https://lore.kernel.org/all/[email protected]/ Signed-off-by: Thomas Zimmermann <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/iters_task.c')
-rw-r--r--tools/testing/selftests/bpf/progs/iters_task.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/iters_task.c b/tools/testing/selftests/bpf/progs/iters_task.c
index c9b4055cd410..e4d53e40ff20 100644
--- a/tools/testing/selftests/bpf/progs/iters_task.c
+++ b/tools/testing/selftests/bpf/progs/iters_task.c
@@ -10,7 +10,7 @@
char _license[] SEC("license") = "GPL";
pid_t target_pid;
-int procs_cnt, threads_cnt, proc_threads_cnt;
+int procs_cnt, threads_cnt, proc_threads_cnt, invalid_cnt;
void bpf_rcu_read_lock(void) __ksym;
void bpf_rcu_read_unlock(void) __ksym;
@@ -26,6 +26,16 @@ int iter_task_for_each_sleep(void *ctx)
procs_cnt = threads_cnt = proc_threads_cnt = 0;
bpf_rcu_read_lock();
+ bpf_for_each(task, pos, NULL, ~0U) {
+ /* Below instructions shouldn't be executed for invalid flags */
+ invalid_cnt++;
+ }
+
+ bpf_for_each(task, pos, NULL, BPF_TASK_ITER_PROC_THREADS) {
+ /* Below instructions shouldn't be executed for invalid task__nullable */
+ invalid_cnt++;
+ }
+
bpf_for_each(task, pos, NULL, BPF_TASK_ITER_ALL_PROCS)
if (pos->pid == target_pid)
procs_cnt++;