diff options
| author | Chuyi Zhou <[email protected]> | 2023-10-31 05:04:36 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2023-11-02 05:49:20 +0000 |
| commit | 3091b667498b0a212e760e1033e5f9b8c33a948f (patch) | |
| tree | 64e1da0f69e939ed6c28ea8b5d32ee3b35033549 /tools/testing/selftests/bpf/prog_tests/tracing_struct.c | |
| parent | selftests/bpf: fix test_maps' use of bpf_map_create_opts (diff) | |
| download | kernel-3091b667498b0a212e760e1033e5f9b8c33a948f.tar.gz kernel-3091b667498b0a212e760e1033e5f9b8c33a948f.zip | |
bpf: Relax allowlist for css_task iter
The newly added open-coded css_task iter would try to hold the global
css_set_lock in bpf_iter_css_task_new, so the bpf side has to be careful in
where it allows to use this iter. The mainly concern is dead locking on
css_set_lock. check_css_task_iter_allowlist() in verifier enforced css_task
can only be used in bpf_lsm hooks and sleepable bpf_iter.
This patch relax the allowlist for css_task iter. Any lsm and any iter
(even non-sleepable) and any sleepable are safe since they would not hold
the css_set_lock before entering BPF progs context.
This patch also fixes the misused BPF_TRACE_ITER in
check_css_task_iter_allowlist which compared bpf_prog_type with
bpf_attach_type.
Fixes: 9c66dc94b62ae ("bpf: Introduce css_task open-coded iterator kfuncs")
Signed-off-by: Chuyi Zhou <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tracing_struct.c')
0 files changed, 0 insertions, 0 deletions
