From: Greg Kroah-Hartman Date: Tue, 25 Jan 2022 11:09:27 +0000 (+0100) Subject: drop libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch from everywhere X-Git-Tag: v4.4.300~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f535660c4fa0db046c4fcf62e4b8cb269636e3a7;p=thirdparty%2Fkernel%2Fstable-queue.git drop libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch from everywhere --- diff --git a/queue-5.10/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch b/queue-5.10/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch deleted file mode 100644 index f51ede2a32e..00000000000 --- a/queue-5.10/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 91230f9cc6744934c144a549c16afe63a5c87ff1 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 3 Nov 2021 10:32:11 -0700 -Subject: libbpf: Validate that .BTF and .BTF.ext sections contain data - -From: Andrii Nakryiko - -[ Upstream commit 62554d52e71797eefa3fc15b54008038837bb2d4 ] - -.BTF and .BTF.ext ELF sections should have SHT_PROGBITS type and contain -data. If they are not, ELF is invalid or corrupted, so bail out. -Otherwise this can lead to data->d_buf being NULL and SIGSEGV later on. -Reported by oss-fuzz project. - -Signed-off-by: Andrii Nakryiko -Signed-off-by: Alexei Starovoitov -Acked-by: Yonghong Song -Link: https://lore.kernel.org/bpf/20211103173213.1376990-4-andrii@kernel.org -Signed-off-by: Sasha Levin ---- - tools/lib/bpf/libbpf.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c -index b337d6f29098b..e8ad53d31044a 100644 ---- a/tools/lib/bpf/libbpf.c -+++ b/tools/lib/bpf/libbpf.c -@@ -2870,8 +2870,12 @@ static int bpf_object__elf_collect(struct bpf_object *obj) - } else if (strcmp(name, MAPS_ELF_SEC) == 0) { - obj->efile.btf_maps_shndx = idx; - } else if (strcmp(name, BTF_ELF_SEC) == 0) { -+ if (sh->sh_type != SHT_PROGBITS) -+ return -LIBBPF_ERRNO__FORMAT; - btf_data = data; - } else if (strcmp(name, BTF_EXT_ELF_SEC) == 0) { -+ if (sh->sh_type != SHT_PROGBITS) -+ return -LIBBPF_ERRNO__FORMAT; - btf_ext_data = data; - } else if (sh.sh_type == SHT_SYMTAB) { - /* already processed during the first pass above */ --- -2.34.1 - diff --git a/queue-5.10/series b/queue-5.10/series index 934b20e1fc2..a9535684f98 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -296,7 +296,6 @@ of-base-fix-phandle-argument-length-mismatch-error-m.patch arm-dts-omap3-n900-fix-lp5523-for-multi-color.patch bluetooth-fix-debugfs-entry-leak-in-hci_register_dev.patch fs-dlm-filter-user-dlm-messages-for-kernel-locks.patch -libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch drm-lima-fix-warning-when-config_debug_sg-y-config_d.patch selftests-bpf-fix-bpf_object-leak-in-skb_ctx-selftes.patch ar5523-fix-null-ptr-deref-with-unexpected-wdcmsg_tar.patch diff --git a/queue-5.15/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch b/queue-5.15/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch deleted file mode 100644 index f77bd5b212b..00000000000 --- a/queue-5.15/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch +++ /dev/null @@ -1,43 +0,0 @@ -From ce963549c52061238ea40165c790d57bee66d6ed Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 3 Nov 2021 10:32:11 -0700 -Subject: libbpf: Validate that .BTF and .BTF.ext sections contain data - -From: Andrii Nakryiko - -[ Upstream commit 62554d52e71797eefa3fc15b54008038837bb2d4 ] - -.BTF and .BTF.ext ELF sections should have SHT_PROGBITS type and contain -data. If they are not, ELF is invalid or corrupted, so bail out. -Otherwise this can lead to data->d_buf being NULL and SIGSEGV later on. -Reported by oss-fuzz project. - -Signed-off-by: Andrii Nakryiko -Signed-off-by: Alexei Starovoitov -Acked-by: Yonghong Song -Link: https://lore.kernel.org/bpf/20211103173213.1376990-4-andrii@kernel.org -Signed-off-by: Sasha Levin ---- - tools/lib/bpf/libbpf.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c -index 0ad29203cbfbf..b7d278b8f4527 100644 ---- a/tools/lib/bpf/libbpf.c -+++ b/tools/lib/bpf/libbpf.c -@@ -3035,8 +3035,12 @@ static int bpf_object__elf_collect(struct bpf_object *obj) - } else if (strcmp(name, MAPS_ELF_SEC) == 0) { - obj->efile.btf_maps_shndx = idx; - } else if (strcmp(name, BTF_ELF_SEC) == 0) { -+ if (sh->sh_type != SHT_PROGBITS) -+ return -LIBBPF_ERRNO__FORMAT; - btf_data = data; - } else if (strcmp(name, BTF_EXT_ELF_SEC) == 0) { -+ if (sh->sh_type != SHT_PROGBITS) -+ return -LIBBPF_ERRNO__FORMAT; - btf_ext_data = data; - } else if (sh.sh_type == SHT_SYMTAB) { - /* already processed during the first pass above */ --- -2.34.1 - diff --git a/queue-5.15/series b/queue-5.15/series index 91628a12bfc..c5ca6e137cb 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -460,7 +460,6 @@ bluetooth-fix-memory-leak-of-hci-device.patch drm-panel-delete-panel-on-mipi_dsi_attach-failure.patch bluetooth-fix-removing-adv-when-processing-cmd-compl.patch fs-dlm-filter-user-dlm-messages-for-kernel-locks.patch -libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch drm-lima-fix-warning-when-config_debug_sg-y-config_d.patch selftests-bpf-fix-memory-leaks-in-btf_type_c_dump-he.patch selftests-bpf-destroy-xdp-link-correctly.patch diff --git a/queue-5.16/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch b/queue-5.16/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch deleted file mode 100644 index b1f50262168..00000000000 --- a/queue-5.16/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0a5fcc947ffa23559574ba76ebbc9e7d71f28911 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 3 Nov 2021 10:32:11 -0700 -Subject: libbpf: Validate that .BTF and .BTF.ext sections contain data - -From: Andrii Nakryiko - -[ Upstream commit 62554d52e71797eefa3fc15b54008038837bb2d4 ] - -.BTF and .BTF.ext ELF sections should have SHT_PROGBITS type and contain -data. If they are not, ELF is invalid or corrupted, so bail out. -Otherwise this can lead to data->d_buf being NULL and SIGSEGV later on. -Reported by oss-fuzz project. - -Signed-off-by: Andrii Nakryiko -Signed-off-by: Alexei Starovoitov -Acked-by: Yonghong Song -Link: https://lore.kernel.org/bpf/20211103173213.1376990-4-andrii@kernel.org -Signed-off-by: Sasha Levin ---- - tools/lib/bpf/libbpf.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c -index c7ba5e6ed9cfe..96cee9cd8c03c 100644 ---- a/tools/lib/bpf/libbpf.c -+++ b/tools/lib/bpf/libbpf.c -@@ -3271,8 +3271,12 @@ static int bpf_object__elf_collect(struct bpf_object *obj) - } else if (strcmp(name, MAPS_ELF_SEC) == 0) { - obj->efile.btf_maps_shndx = idx; - } else if (strcmp(name, BTF_ELF_SEC) == 0) { -+ if (sh->sh_type != SHT_PROGBITS) -+ return -LIBBPF_ERRNO__FORMAT; - btf_data = data; - } else if (strcmp(name, BTF_EXT_ELF_SEC) == 0) { -+ if (sh->sh_type != SHT_PROGBITS) -+ return -LIBBPF_ERRNO__FORMAT; - btf_ext_data = data; - } else if (sh->sh_type == SHT_SYMTAB) { - /* already processed during the first pass above */ --- -2.34.1 - diff --git a/queue-5.16/series b/queue-5.16/series index ecb43f109db..39ecda0e564 100644 --- a/queue-5.16/series +++ b/queue-5.16/series @@ -544,7 +544,6 @@ drm-sched-avoid-lockdep-spalt-on-killing-a-processes.patch fs-dlm-filter-user-dlm-messages-for-kernel-locks.patch libbpf-detect-corrupted-elf-symbols-section.patch libbpf-improve-sanity-checking-during-btf-fix-up.patch -libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch drm-lima-fix-warning-when-config_debug_sg-y-config_d.patch selftests-bpf-fix-memory-leaks-in-btf_type_c_dump-he.patch selftests-bpf-destroy-xdp-link-correctly.patch diff --git a/queue-5.4/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch b/queue-5.4/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch deleted file mode 100644 index da5bdb9eb6e..00000000000 --- a/queue-5.4/libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 2c8310d2705aea870ef92f89c49c504648aea9fc Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 3 Nov 2021 10:32:11 -0700 -Subject: libbpf: Validate that .BTF and .BTF.ext sections contain data - -From: Andrii Nakryiko - -[ Upstream commit 62554d52e71797eefa3fc15b54008038837bb2d4 ] - -.BTF and .BTF.ext ELF sections should have SHT_PROGBITS type and contain -data. If they are not, ELF is invalid or corrupted, so bail out. -Otherwise this can lead to data->d_buf being NULL and SIGSEGV later on. -Reported by oss-fuzz project. - -Signed-off-by: Andrii Nakryiko -Signed-off-by: Alexei Starovoitov -Acked-by: Yonghong Song -Link: https://lore.kernel.org/bpf/20211103173213.1376990-4-andrii@kernel.org -Signed-off-by: Sasha Levin ---- - tools/lib/bpf/libbpf.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c -index 2a1dbf52fc9a5..54e776886bf1e 100644 ---- a/tools/lib/bpf/libbpf.c -+++ b/tools/lib/bpf/libbpf.c -@@ -1578,8 +1578,12 @@ static int bpf_object__elf_collect(struct bpf_object *obj, int flags) - } else if (strcmp(name, MAPS_ELF_SEC) == 0) { - obj->efile.btf_maps_shndx = idx; - } else if (strcmp(name, BTF_ELF_SEC) == 0) { -+ if (sh->sh_type != SHT_PROGBITS) -+ return -LIBBPF_ERRNO__FORMAT; - btf_data = data; - } else if (strcmp(name, BTF_EXT_ELF_SEC) == 0) { -+ if (sh->sh_type != SHT_PROGBITS) -+ return -LIBBPF_ERRNO__FORMAT; - btf_ext_data = data; - } else if (sh.sh_type == SHT_SYMTAB) { - if (obj->efile.symbols) { --- -2.34.1 - diff --git a/queue-5.4/series b/queue-5.4/series index 0ddbf23c612..d3de5bac66b 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -150,7 +150,6 @@ rdma-cxgb4-set-queue-pair-state-when-being-queried.patch of-base-fix-phandle-argument-length-mismatch-error-m.patch bluetooth-fix-debugfs-entry-leak-in-hci_register_dev.patch fs-dlm-filter-user-dlm-messages-for-kernel-locks.patch -libbpf-validate-that-.btf-and-.btf.ext-sections-cont.patch drm-lima-fix-warning-when-config_debug_sg-y-config_d.patch ar5523-fix-null-ptr-deref-with-unexpected-wdcmsg_tar.patch drm-nouveau-pmu-gm200-avoid-touching-pmu-outside-of-.patch