mbox series

[bpf-next,v4,0/3] Relax allowlist for open-coded css_task iter

Message ID 20231031050438.93297-1-zhouchuyi@bytedance.com (mailing list archive)
Headers show
Series Relax allowlist for open-coded css_task iter | expand

Message

Chuyi Zhou Oct. 31, 2023, 5:04 a.m. UTC
Hi,
The patchset aims to relax the allowlist for open-coded css_task iter
suggested by Alexei[1].

Please see individual patches for more details. And comments are always
welcome.

Patch summary:
 * Patch #1: Relax the allowlist and let css_task iter can be used in
   bpf iters and any sleepable progs.
 * Patch #2: Add a test in cgroup_iters.c which demonstrates how
   css_task iters can be combined with cgroup iter.
 * Patch #3: Add a test to prove css_task iter can be used in normal
 * sleepable progs.
link[1]:https://lore.kernel.org/lkml/CAADnVQKafk_junRyE=-FVAik4hjTRDtThymYGEL8hGTuYoOGpA@mail.gmail.com/

---

Changes in v2:
 * Fix the incorrect logic in check_css_task_iter_allowlist. Use
   expected_attach_type to check whether we are using bpf_iters.
 * Link to v1:https://lore.kernel.org/bpf/20231022154527.229117-1-zhouchuyi@bytedance.com/T/#m946f9cde86b44a13265d9a44c5738a711eb578fd
Changes in v3:
 * Add a testcase to prove css_task can be used in fentry.s
 * Link to v2:https://lore.kernel.org/bpf/20231024024240.42790-1-zhouchuyi@bytedance.com/T/#m14a97041ff56c2df21bc0149449abd275b73f6a3
Changes in v4:
 * Add Yonghong's ack for patch #1 and patch #2.
 * Solve Yonghong's comments for patch #2
 * Move prog 'iter_css_task_for_each_sleep' from iters_task_failure.c to
   iters_css_task.c. Use RUN_TESTS to prove we can load this prog.
 * Link to v3:https://lore.kernel.org/bpf/20231025075914.30979-1-zhouchuyi@bytedance.com/T/#m3200d8ad29af4ffab97588e297361d0a45d7585d

---

Chuyi Zhou (3):
  bpf: Relax allowlist for css_task iter
  selftests/bpf: Add tests for css_task iter combining with cgroup iter
  selftests/bpf: Add test for using css_task iter in sleepable progs

 kernel/bpf/verifier.c                         | 16 +++--
 .../selftests/bpf/prog_tests/cgroup_iter.c    | 33 ++++++++++
 .../testing/selftests/bpf/prog_tests/iters.c  |  1 +
 .../selftests/bpf/progs/iters_css_task.c      | 63 +++++++++++++++++++
 .../selftests/bpf/progs/iters_task_failure.c  |  4 +-
 5 files changed, 111 insertions(+), 6 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 2, 2023, 6:10 a.m. UTC | #1
Hello:

This series was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Tue, 31 Oct 2023 13:04:35 +0800 you wrote:
> Hi,
> The patchset aims to relax the allowlist for open-coded css_task iter
> suggested by Alexei[1].
> 
> Please see individual patches for more details. And comments are always
> welcome.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v4,1/3] bpf: Relax allowlist for css_task iter
    https://git.kernel.org/bpf/bpf/c/3091b667498b
  - [bpf-next,v4,2/3] selftests/bpf: Add tests for css_task iter combining with cgroup iter
    https://git.kernel.org/bpf/bpf/c/f49843afde67
  - [bpf-next,v4,3/3] selftests/bpf: Add test for using css_task iter in sleepable progs
    https://git.kernel.org/bpf/bpf/c/d8234d47c4aa

You are awesome, thank you!