Re: [PATCH bpf-next] bpf: sched_ext: Mark ops argument container pointer fields as trusted
| Newsgroups | dev.linux.lists.sched-ext,org.kernel.vger.bpf,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <758be5cbbea1b61eeaad2454d28f13a1acb1f3d0d50893b7707d9afdcea131e7@mail.kernel.org> |
> bpf: sched_ext: Mark ops argument container pointer fields as trusted > > Walking an unannotated pointer field of a trusted struct yields a bare > PTR_TO_BTF_ID in non-sleepable programs, which kfuncs and helpers accept, > but PTR_UNTRUSTED in sleepable programs, which they reject. This gets in the > way of making ops.init_task() sleepable, which schedulers want for > allocations. For example, passing args->cgroup into bpf_cgrp_storage_get() > then fails verification and the only recourse is round-tripping through the > cgroup ID with bpf_cgroup_from_id(). > > The pointer fields in the sched_ext ops argument containers are all pinned > by the callers for the duration of the ops calls and are never NULL. Add > them to the verifier's trusted-fields whitelist so that they are PTR_TRUSTED > in both sleepable and non-sleepable programs. > > Signed-off-by: Tejun Heo <[email protected]> This looks like a bug fix for verification failures in sleepable programs. Should this include: Fixes: 8195136669661 ("sched_ext: Add cgroup support") --- AI reviewed your patch. Please fix the bug or email reply why it's not a bug. See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md CI run summary: https://github.com/kernel-patches/bpf/actions/runs/32336047878