From: Greg Kroah-Hartman Date: Tue, 16 Nov 2021 14:15:56 +0000 (+0100) Subject: fix up queue-5.4/libbpf-fix-btf-data-layout-checks-and-allow-empty-bt.patch X-Git-Tag: v5.4.160~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c955c8b29df21a1653d7fd0bd485719b8639c5b;p=thirdparty%2Fkernel%2Fstable-queue.git fix up queue-5.4/libbpf-fix-btf-data-layout-checks-and-allow-empty-bt.patch --- diff --git a/queue-5.4/libbpf-fix-btf-data-layout-checks-and-allow-empty-bt.patch b/queue-5.4/libbpf-fix-btf-data-layout-checks-and-allow-empty-bt.patch index 95254be807a..6762d1fe3ff 100644 --- a/queue-5.4/libbpf-fix-btf-data-layout-checks-and-allow-empty-bt.patch +++ b/queue-5.4/libbpf-fix-btf-data-layout-checks-and-allow-empty-bt.patch @@ -23,21 +23,19 @@ Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20201105043402.2530976-8-andrii@kernel.org Signed-off-by: Sasha Levin --- - 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; } @@ -59,6 +57,3 @@ index d606a358480da..3380aadb74655 100644 pr_debug("BTF type section is not aligned to 4 bytes\n"); return -EINVAL; } --- -2.33.0 -