[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMB2axN+HNH+XOrEDKRwg8rDywOxPBEjWNQCp0FaNxsFnbvArw@mail.gmail.com>
Date: Thu, 13 Feb 2025 21:44:52 -0800
From: Amery Hung <ameryhung@...il.com>
To: Martin KaFai Lau <martin.lau@...ux.dev>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org, daniel@...earbox.net,
andrii@...nel.org, alexei.starovoitov@...il.com, martin.lau@...nel.org,
kuba@...nel.org, edumazet@...gle.com, xiyou.wangcong@...il.com,
cong.wang@...edance.com, jhs@...atatu.com, sinquersw@...il.com,
toke@...hat.com, jiri@...nulli.us, stfomichev@...il.com,
ekarani.silvestre@....ufcg.edu.br, yangpeihao@...u.edu.cn,
yepeilin.cs@...il.com, kernel-team@...a.com
Subject: Re: [PATCH bpf-next v4 01/19] bpf: Make every prog keep a copy of ctx_arg_info
On Thu, Feb 13, 2025 at 11:54 AM Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>
> On 2/10/25 9:43 AM, Amery Hung wrote:
> > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > index 9971c03adfd5..a41ba019780f 100644
> > --- a/kernel/bpf/verifier.c
> > +++ b/kernel/bpf/verifier.c
> > @@ -22377,6 +22377,18 @@ static void print_verification_stats(struct bpf_verifier_env *env)
> > env->peak_states, env->longest_mark_read_walk);
> > }
> >
> > +int bpf_prog_ctx_arg_info_init(struct bpf_prog *prog,
> > + const struct bpf_ctx_arg_aux *info, u32 cnt)
> > +{
> > + prog->aux->ctx_arg_info = kcalloc(cnt, sizeof(*info), GFP_KERNEL);
>
> Missing a kfree.
Thanks for catching this. I will fix it.
>
> > + if (!prog->aux->ctx_arg_info)
> > + return -ENOMEM;
> > +
> > + memcpy(prog->aux->ctx_arg_info, info, sizeof(*info) * cnt);
> > + prog->aux->ctx_arg_info_size = cnt;
> > + return 0;
> > +}
> > +
Powered by blists - more mailing lists