Re: [RFC PATCH v2 8/8] signal: move group_leader into signal_struct

From: bot+bpf-ci

Date: Sat Dec 05 2026 - 08:54:19 EST


> signal: move group_leader into signal_struct

TL;DR: Removing task_struct::group_leader may break the verifier_arena_cast
selftest, which still reads it via CO-RE. The load may fail and the "arena
cast" subtest may then fail. Unverified; it likely needs converting like the
other selftests.

> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 691a1e322985..123877b74262 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1104,7 +1104,6 @@ struct task_struct {
> */
> struct list_head children;
> struct list_head sibling;
> - struct task_struct *group_leader;
>
> /*

This removes task_struct::group_leader, but
tools/testing/selftests/bpf/progs/verifier_arena_cast.c still reads it
through its own preserve_access_index definition of struct task_struct:

struct task_struct {
struct task_struct *group_leader;
void *stack;
} __attribute__((preserve_access_index));
...
int untrusted_btf_id(void *ctx)
{
CAST_R6(bpf_get_current_task_btf()->group_leader);
return 0;
}

Because the local struct is used, the file still compiles. At load time,
though, can libbpf resolve the CO-RE relocation for task_struct.group_leader
against a vmlinux BTF that no longer has the field?

If it can't, the load instruction is poisoned and the verifier rejects
untrusted_btf_id(), which is annotated __success with
__msg("R6=untrusted_ptr_task_struct()"). Won't "test_progs -t
verifier_arena_cast" then fail for the "arena cast: an untrusted pointer to
task_struct, it's a move" subtest?

This was the only remaining group_leader reference under
tools/testing/selftests/, and none of the later patches in the series
converts it.

Should it get the same conversion as the other selftests, for example
bpf_get_current_task_btf()->signal->group_leader with a matching local
struct signal_struct? Alternatively, another task_struct pointer field
that the verifier treats as untrusted, such as real_parent read outside an
RCU section, would also satisfy the test.


---
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/47525108594