diff options
author | Chuyi Zhou <zhouchuyi@bytedance.com> | 2023-10-31 13:04:36 +0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-11-01 22:49:20 -0700 |
commit | 3091b667498b0a212e760e1033e5f9b8c33a948f (patch) | |
tree | 64e1da0f69e939ed6c28ea8b5d32ee3b35033549 /drivers/pwm/pwm-microchip-core.c | |
parent | 9af3775962afa8b5cd0cc30c1e454405a650c1f3 (diff) |
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 <zhouchuyi@bytedance.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231031050438.93297-2-zhouchuyi@bytedance.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'drivers/pwm/pwm-microchip-core.c')
0 files changed, 0 insertions, 0 deletions