]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up queue-5.4/libbpf-fix-btf-data-layout-checks-and-allow-empty-bt.patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Nov 2021 14:15:56 +0000 (15:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Nov 2021 14:15:56 +0000 (15:15 +0100)
queue-5.4/libbpf-fix-btf-data-layout-checks-and-allow-empty-bt.patch

index 95254be807a96754c3bda665f0bff34873183183..6762d1fe3ff279d5a9166cfed2ec958e474e4a29 100644 (file)
@@ -23,21 +23,19 @@ Signed-off-by: Alexei Starovoitov <ast@kernel.org>
 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;
        }
  
@@ -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
-