> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
> index a656a8572bdb..d85869544dc8 100644
> --- a/kernel/bpf/core.c
> +++ b/kernel/bpf/core.c
> @@ -2480,8 +2480,12 @@ static bool __bpf_prog_map_compatible(struct bpf_map 
> *map,
>                               break;
>                       cookie = aux->cgroup_storage[i] ?
>                                aux->cgroup_storage[i]->cookie : 0;
> -                     ret = map->owner->storage_cookie[i] == cookie ||
> -                           !cookie;
> +                     /*
> +                      * Tail calls keep using the caller cgroup storage
> +                      * context, so prog-array members must use the same
> +                      * storage cookie.
> +                      */
> +                     ret = map->owner->storage_cookie[i] == cookie;
>               }
>               if (ret &&
>                   map->owner->attach_func_proto != aux->attach_func_proto) {

Related to this patch series, Leon Hwang raised a concern about test
placement in the selftest file (tools/testing/selftests/bpf/prog_tests/
tailcalls.c). The new cgroup storage tail-call tests should be placed at
the tail of test_tailcalls() rather than before tailcall_failure and
tailcall_sleepable.

Reference: 
https://lore.kernel.org/bpf/[email protected]/

Leon's comment from v2: "These new ones should stay at the tail of
test_tailcalls()."

Should the test ordering be adjusted in the selftest file to address this
feedback?


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

Reply via email to