Link: https://lore.kernel.org/bpf/20201105043402.2530976-8-andrii@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- tools/lib/bpf/btf.c | 16 ++++++----------
+ tools/lib/bpf/btf.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
-diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
-index d606a358480da..3380aadb74655 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
-@@ -100,22 +100,18 @@ static int btf_parse_hdr(struct btf *btf)
+@@ -100,22 +100,18 @@ static int btf_parse_hdr(struct btf *btf
return -EINVAL;
}
- if (meta_left < hdr->type_off) {
- pr_debug("Invalid BTF type section offset:%u\n", hdr->type_off);
+ if (meta_left < hdr->str_off + hdr->str_len) {
-+ pr_debug("Invalid BTF total size:%u\n", btf->raw_size);
++ pr_debug("Invalid BTF total size:%u\n", btf->data_size);
return -EINVAL;
}
pr_debug("BTF type section is not aligned to 4 bytes\n");
return -EINVAL;
}
---
-2.33.0
-