Skip to content
Commit 49e0263a authored by Feng Zhou's avatar Feng Zhou Committed by Alexei Starovoitov
Browse files

selftests/bpf: Add testcase for bpf_task_under_cgroup



test_progs:
Tests new kfunc bpf_task_under_cgroup().

The bpf program saves the new task's pid within a given cgroup to
the remote_pid, which is convenient for the user-mode program to
verify the test correctness.

The user-mode program creates its own mount namespace, and mounts the
cgroupsv2 hierarchy in there, call the fork syscall, then check if
remote_pid and local_pid are unequal.

Signed-off-by: default avatarFeng Zhou <zhoufeng.zf@bytedance.com>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20230506031545.35991-3-zhoufeng.zf@bytedance.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent b5ad4cdc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment