lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0bee571a-927d-4042-9e89-53bf695ec054@linux.dev>
Date: Thu, 13 Feb 2025 11:54:41 -0800
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Amery Hung <ameryhung@...il.com>
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 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.

> +	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

Powered by Openwall GNU/*/Linux Powered by OpenVZ