diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 9a1aba2d007334b8e1dc87d3e8eef0c444f1f923..12cd2997f982a1e0cac7e9abb0e8ac1fdd3ca261 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -11429,6 +11429,11 @@ static int check_struct_ops_btf_id(struct bpf_verifier_env *env) u32 btf_id, member_idx; const char *mname; + if (!prog->gpl_compatible) { + verbose(env, "struct ops programs must have a GPL compatible license\n"); + return -EINVAL; + } + btf_id = prog->aux->attach_btf_id; st_ops = bpf_struct_ops_find(btf_id); if (!st_ops) {