On Wed, Jun 3, 2026 at 8:11 PM <[email protected]> wrote:
>
> From: Yuan Chen <[email protected]>
>
> obj_priv_btf_success, obj_priv_implicit_token and
> obj_priv_implicit_token_envvar use the dummy_st_ops_success skeleton,
> whose struct_ops programs reference global variables backed by ARRAY
> maps.  Without BPF_MAP_TYPE_ARRAY in the token allowed map types,
> bpf_object__load() fails because the kernel rejects ARRAY map creation
> for global data.
>
> Add BPF_MAP_TYPE_ARRAY to the token permission mask for these three
> subtests so their skeletons can load successfully.
>
> This is distinct from the libbpf probe issue: the skeletons genuinely
> require ARRAY maps for their global data, not merely for probing.
>
> Signed-off-by: Yuan Chen <[email protected]>
> ---
>  tools/testing/selftests/bpf/prog_tests/token.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/token.c 
> b/tools/testing/selftests/bpf/prog_tests/token.c
> index f2f5d36ae00a..1812de87bedb 100644
> --- a/tools/testing/selftests/bpf/prog_tests/token.c
> +++ b/tools/testing/selftests/bpf/prog_tests/token.c
> @@ -1214,7 +1214,7 @@ void serial_test_token(void)
>                 struct bpffs_opts opts = {
>                         /* allow BTF loading */
>                         .cmds = bit(BPF_BTF_LOAD) | bit(BPF_MAP_CREATE) | 
> bit(BPF_PROG_LOAD),
> -                       .maps = bit(BPF_MAP_TYPE_STRUCT_OPS),
> +                       .maps = bit(BPF_MAP_TYPE_STRUCT_OPS) | 
> bit(BPF_MAP_TYPE_ARRAY),
>                         .progs = bit(BPF_PROG_TYPE_STRUCT_OPS),
>                         .attachs = ~0ULL,
>                 };
> @@ -1225,7 +1225,7 @@ void serial_test_token(void)
>                 struct bpffs_opts opts = {
>                         /* allow BTF loading */
>                         .cmds = bit(BPF_BTF_LOAD) | bit(BPF_MAP_CREATE) | 
> bit(BPF_PROG_LOAD),
> -                       .maps = bit(BPF_MAP_TYPE_STRUCT_OPS),
> +                       .maps = bit(BPF_MAP_TYPE_STRUCT_OPS) | 
> bit(BPF_MAP_TYPE_ARRAY),
>                         .progs = bit(BPF_PROG_TYPE_STRUCT_OPS),
>                         .attachs = ~0ULL,
>                 };
> @@ -1236,7 +1236,7 @@ void serial_test_token(void)
>                 struct bpffs_opts opts = {
>                         /* allow BTF loading */
>                         .cmds = bit(BPF_BTF_LOAD) | bit(BPF_MAP_CREATE) | 
> bit(BPF_PROG_LOAD),
> -                       .maps = bit(BPF_MAP_TYPE_STRUCT_OPS),
> +                       .maps = bit(BPF_MAP_TYPE_STRUCT_OPS) | 
> bit(BPF_MAP_TYPE_ARRAY),

Hm.. ARRAY map is unprivileged, you shouldn't need this. Are you sure
this test failing for you is not a consequence of the issue you fixed
in the first patch?

>                         .progs = bit(BPF_PROG_TYPE_STRUCT_OPS),
>                         .attachs = ~0ULL,
>                 };
> --
> 2.54.0
>

Reply via email to