[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0f3f22dd-1f31-ac13-7bde-31d727ca523d@iogearbox.net>
Date: Tue, 16 Oct 2018 00:36:45 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: Yonghong Song <yhs@...com>, ast@...com, kafai@...com,
netdev@...r.kernel.org
Cc: kernel-team@...com
Subject: Re: [PATCH bpf-next 02/13] bpf: btf: Add BTF_KIND_FUNC and
BTF_KIND_FUNC_PROTO
On 10/12/2018 08:54 PM, Yonghong Song wrote:
[...]
> +static bool btf_name_valid_identifier(const struct btf *btf, u32 offset)
> +{
> + /* offset must be valid */
> + const char *src = &btf->strings[offset];
> +
> + if (!isalpha(*src) && *src != '_')
> + return false;
> +
> + src++;
> + while (*src) {
> + if (!isalnum(*src) && *src != '_')
> + return false;
> + src++;
> + }
> +
> + return true;
> +}
Should there be an upper name length limit like KSYM_NAME_LEN? (Is it implied
by the kvmalloc() limit?)
> static const char *btf_name_by_offset(const struct btf *btf, u32 offset)
> {
> if (!offset)
> @@ -747,7 +782,9 @@ static bool env_type_is_resolve_sink(const struct btf_verifier_env *env,
> /* int, enum or void is a sink */
> return !btf_type_needs_resolve(next_type);
> case RESOLVE_PTR:
> - /* int, enum, void, struct or array is a sink for ptr */
> + /* int, enum, void, struct, array or func_ptoto is a sink
> + * for ptr
> + */
> return !btf_type_is_modifier(next_type) &&
> !btf_type_is_ptr(next_type);
> case RESOLVE_STRUCT_OR_ARRAY:
Powered by blists - more mailing lists