On Thu, Aug 18, 2022 at 04:27:26PM -0700, Stanislav Fomichev wrote: > diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c > index fa71d58b7ded..6eba60248e20 100644 > --- a/kernel/bpf/bpf_lsm.c > +++ b/kernel/bpf/bpf_lsm.c > @@ -189,6 +189,16 @@ static const struct bpf_func_proto bpf_get_attach_cookie_proto = { > static const struct bpf_func_proto * > bpf_lsm_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) > { > +#ifdef CONFIG_CGROUP_BPF This probably is not needed. Others lgtm. > + const struct bpf_func_proto *func_proto; > + > + if (prog->expected_attach_type == BPF_LSM_CGROUP) { > + func_proto = cgroup_common_func_proto(func_id, prog); > + if (func_proto) > + return func_proto; > + } > +#endif