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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 7 Aug 2020 11:45:47 +0200 From: Jiri Olsa <jolsa@...nel.org> To: Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, Andrii Nakryiko <andriin@...com> Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>, Martin KaFai Lau <kafai@...com>, David Miller <davem@...hat.com>, John Fastabend <john.fastabend@...il.com>, Wenbo Zhang <ethercflow@...il.com>, KP Singh <kpsingh@...omium.org>, Brendan Gregg <bgregg@...flix.com>, Florent Revest <revest@...omium.org>, Al Viro <viro@...iv.linux.org.uk> Subject: [PATCH v10 bpf-next 02/14] tools resolve_btfids: Add support for set symbols The set symbol does not have the unique number suffix, so we need to give it a special parsing function. This was omitted in the first batch, because there was no set support yet, so it slipped in the testing. Acked-by: Andrii Nakryiko <andriin@...com> Signed-off-by: Jiri Olsa <jolsa@...nel.org> --- tools/bpf/resolve_btfids/main.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c index b83369887df6..81782c3ff485 100644 --- a/tools/bpf/resolve_btfids/main.c +++ b/tools/bpf/resolve_btfids/main.c @@ -227,6 +227,24 @@ static char *get_id(const char *prefix_end) return id; } +static struct btf_id *add_set(struct object *obj, char *name) +{ + /* + * __BTF_ID__set__name + * name = ^ + * id = ^ + */ + char *id = name + sizeof(BTF_SET "__") - 1; + int len = strlen(name); + + if (id >= name + len) { + pr_err("FAILED to parse set name: %s\n", name); + return NULL; + } + + return btf_id__add(&obj->sets, id, true); +} + static struct btf_id *add_symbol(struct rb_root *root, char *name, size_t size) { char *id; @@ -383,7 +401,7 @@ static int symbols_collect(struct object *obj) id = add_symbol(&obj->funcs, prefix, sizeof(BTF_FUNC) - 1); /* set */ } else if (!strncmp(prefix, BTF_SET, sizeof(BTF_SET) - 1)) { - id = add_symbol(&obj->sets, prefix, sizeof(BTF_SET) - 1); + id = add_set(obj, prefix); /* * SET objects store list's count, which is encoded * in symbol's size, together with 'cnt' field hence -- 2.25.4
Powered by blists - more mailing lists