From 66820ad2bdd20d864ba3e94694091eb69886c643 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 18 Oct 2022 13:29:30 +0200 Subject: [PATCH] drop some unneeded libbpf patches --- ...quire-executable-permission-for-shar.patch | 11 ++-- ...-if-sec-freplace-programs-don-t-have.patch | 11 ++-- ...tial-null-dereference-when-parsing-e.patch | 38 -------------- ...y-sections-in-bpf_object__init_globa.patch | 51 ------------------- queue-6.0/series | 2 - 5 files changed, 6 insertions(+), 107 deletions(-) delete mode 100644 queue-6.0/libbpf-fix-potential-null-dereference-when-parsing-e.patch delete mode 100644 queue-6.0/libbpf-skip-empty-sections-in-bpf_object__init_globa.patch diff --git a/queue-6.0/libbpf-do-not-require-executable-permission-for-shar.patch b/queue-6.0/libbpf-do-not-require-executable-permission-for-shar.patch index 858e9c60808..dad594aa090 100644 --- a/queue-6.0/libbpf-do-not-require-executable-permission-for-shar.patch +++ b/queue-6.0/libbpf-do-not-require-executable-permission-for-shar.patch @@ -19,14 +19,12 @@ Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220806102021.3867130-1-hengqi.chen@gmail.com Signed-off-by: Sasha Levin --- - tools/lib/bpf/libbpf.c | 8 +++++--- + tools/lib/bpf/libbpf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c -index c0af210f1acd..6b40c8672ff9 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c -@@ -10671,15 +10671,17 @@ static const char *arch_specific_lib_paths(void) +@@ -10667,15 +10667,17 @@ static const char *arch_specific_lib_pat static int resolve_full_path(const char *file, char *result, size_t result_sz) { const char *search_paths[3] = {}; @@ -45,7 +43,7 @@ index c0af210f1acd..6b40c8672ff9 100644 } for (i = 0; i < ARRAY_SIZE(search_paths); i++) { -@@ -10698,8 +10700,8 @@ static int resolve_full_path(const char *file, char *result, size_t result_sz) +@@ -10694,8 +10696,8 @@ static int resolve_full_path(const char if (!seg_len) continue; snprintf(result, result_sz, "%.*s/%s", seg_len, s, file); @@ -56,6 +54,3 @@ index c0af210f1acd..6b40c8672ff9 100644 continue; pr_debug("resolved '%s' to '%s'\n", file, result); return 0; --- -2.35.1 - diff --git a/queue-6.0/libbpf-fix-crash-if-sec-freplace-programs-don-t-have.patch b/queue-6.0/libbpf-fix-crash-if-sec-freplace-programs-don-t-have.patch index 86ec5aab315..70f780bc1b7 100644 --- a/queue-6.0/libbpf-fix-crash-if-sec-freplace-programs-don-t-have.patch +++ b/queue-6.0/libbpf-fix-crash-if-sec-freplace-programs-don-t-have.patch @@ -23,14 +23,12 @@ Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220909193053.577111-3-andrii@kernel.org Signed-off-by: Sasha Levin --- - tools/lib/bpf/libbpf.c | 13 +++++++++---- + tools/lib/bpf/libbpf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c -index 159f60a245c0..c0af210f1acd 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c -@@ -9060,11 +9060,15 @@ static int libbpf_find_attach_btf_id(struct bpf_program *prog, const char *attac +@@ -9056,11 +9056,15 @@ static int libbpf_find_attach_btf_id(str int err = 0; /* BPF program's BTF ID */ @@ -49,7 +47,7 @@ index 159f60a245c0..c0af210f1acd 100644 return err; } *btf_obj_fd = 0; -@@ -9081,7 +9085,8 @@ static int libbpf_find_attach_btf_id(struct bpf_program *prog, const char *attac +@@ -9077,7 +9081,8 @@ static int libbpf_find_attach_btf_id(str err = find_kernel_btf_id(prog->obj, attach_name, attach_type, btf_obj_fd, btf_type_id); } if (err) { @@ -59,6 +57,3 @@ index 159f60a245c0..c0af210f1acd 100644 return err; } return 0; --- -2.35.1 - diff --git a/queue-6.0/libbpf-fix-potential-null-dereference-when-parsing-e.patch b/queue-6.0/libbpf-fix-potential-null-dereference-when-parsing-e.patch deleted file mode 100644 index b4fbbbc9cbe..00000000000 --- a/queue-6.0/libbpf-fix-potential-null-dereference-when-parsing-e.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 840907e2c3ddba191cce6d1dd2ba876e60d44cdf Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 15 Aug 2022 17:19:26 -0700 -Subject: libbpf: Fix potential NULL dereference when parsing ELF - -From: Andrii Nakryiko - -[ Upstream commit d4e6d684f3bea46a2fc195765c77a3b26bcb080e ] - -Fix if condition filtering empty ELF sections to prevent NULL -dereference. - -Fixes: 47ea7417b074 ("libbpf: Skip empty sections in bpf_object__init_global_data_maps") -Signed-off-by: Andrii Nakryiko -Signed-off-by: Daniel Borkmann -Acked-by: Hao Luo -Link: https://lore.kernel.org/bpf/20220816001929.369487-2-andrii@kernel.org -Signed-off-by: Sasha Levin ---- - tools/lib/bpf/libbpf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c -index 77e3797cf75a..159f60a245c0 100644 ---- a/tools/lib/bpf/libbpf.c -+++ b/tools/lib/bpf/libbpf.c -@@ -1643,7 +1643,7 @@ static int bpf_object__init_global_data_maps(struct bpf_object *obj) - sec_desc = &obj->efile.secs[sec_idx]; - - /* Skip recognized sections with size 0. */ -- if (sec_desc->data && sec_desc->data->d_size == 0) -+ if (!sec_desc->data || sec_desc->data->d_size == 0) - continue; - - switch (sec_desc->sec_type) { --- -2.35.1 - diff --git a/queue-6.0/libbpf-skip-empty-sections-in-bpf_object__init_globa.patch b/queue-6.0/libbpf-skip-empty-sections-in-bpf_object__init_globa.patch deleted file mode 100644 index e3e2a13e5b6..00000000000 --- a/queue-6.0/libbpf-skip-empty-sections-in-bpf_object__init_globa.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 53cf72d08dd3e8e7e86b880f4355459ce35bcfe7 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sun, 31 Jul 2022 17:26:49 -0600 -Subject: libbpf: Skip empty sections in bpf_object__init_global_data_maps - -From: James Hilliard - -[ Upstream commit 47ea7417b0744324424405fc1207e266053237a9 ] - -The GNU assembler generates an empty .bss section. This is a well -established behavior in GAS that happens in all supported targets. - -The LLVM assembler doesn't generate an empty .bss section. - -bpftool chokes on the empty .bss section. - -Additionally in bpf_object__elf_collect the sec_desc->data is not -initialized when a section is not recognized. In this case, this -happens with .comment. - -So we must check that sec_desc->data is initialized before checking -if the size is 0. - -Signed-off-by: James Hilliard -Signed-off-by: Andrii Nakryiko -Acked-by: Jiri Olsa -Link: https://lore.kernel.org/bpf/20220731232649.4668-1-james.hilliard1@gmail.com -Stable-dep-of: 3045f42a6432 ("libbpf: Initialize err in probe_map_create") -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 50d41815f431..77e3797cf75a 100644 ---- a/tools/lib/bpf/libbpf.c -+++ b/tools/lib/bpf/libbpf.c -@@ -1642,6 +1642,10 @@ static int bpf_object__init_global_data_maps(struct bpf_object *obj) - for (sec_idx = 1; sec_idx < obj->efile.sec_cnt; sec_idx++) { - sec_desc = &obj->efile.secs[sec_idx]; - -+ /* Skip recognized sections with size 0. */ -+ if (sec_desc->data && sec_desc->data->d_size == 0) -+ continue; -+ - switch (sec_desc->sec_type) { - case SEC_DATA: - sec_name = elf_sec_name(obj, elf_sec_by_idx(obj, sec_idx)); --- -2.35.1 - diff --git a/queue-6.0/series b/queue-6.0/series index d4b2ef35c34..5ac7ba55d2b 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -225,7 +225,6 @@ nfsd-protect-against-send-buffer-overflow-in-nfsv2-r.patch nfsd-fix-handling-of-oversized-nfsv4-compound-reques.patch x86-paravirt-add-extra-clobbers-with-zero_call_used_.patch m68k-process-bootinfo-records-before-saving-them.patch -libbpf-skip-empty-sections-in-bpf_object__init_globa.patch libbpf-initialize-err-in-probe_map_create.patch wifi-rtw88-8822c-extend-supported-probe-request-size.patch wifi-rtlwifi-8192de-correct-checking-of-iqk-reload.patch @@ -235,7 +234,6 @@ bpf-cleanup-check_refcount_ok.patch bpf-fix-ref_obj_id-for-dynptr-data-slices-in-verifie.patch spi-s3c64xx-correct-dma_chan-pointer-initialization.patch leds-lm3601x-don-t-use-mutex-after-it-was-destroyed.patch -libbpf-fix-potential-null-dereference-when-parsing-e.patch tsnep-fix-tsnep_info_tx_time-register-define.patch net-prestera-cache-port-state-for-non-phylink-ports-.patch bpf-fix-reference-state-management-for-synchronous-c.patch -- 2.47.3