Link: https://lore.kernel.org/bpf/20220806102021.3867130-1-hengqi.chen@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- 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] = {};
}
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);
continue;
pr_debug("resolved '%s' to '%s'\n", file, result);
return 0;
---
-2.35.1
-
Link: https://lore.kernel.org/bpf/20220909193053.577111-3-andrii@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- 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 */
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) {
return err;
}
return 0;
---
-2.35.1
-
+++ /dev/null
-From 840907e2c3ddba191cce6d1dd2ba876e60d44cdf Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 15 Aug 2022 17:19:26 -0700
-Subject: libbpf: Fix potential NULL dereference when parsing ELF
-
-From: Andrii Nakryiko <andrii@kernel.org>
-
-[ 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 <andrii@kernel.org>
-Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-Acked-by: Hao Luo <haoluo@google.com>
-Link: https://lore.kernel.org/bpf/20220816001929.369487-2-andrii@kernel.org
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- 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
-
+++ /dev/null
-From 53cf72d08dd3e8e7e86b880f4355459ce35bcfe7 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Sun, 31 Jul 2022 17:26:49 -0600
-Subject: libbpf: Skip empty sections in bpf_object__init_global_data_maps
-
-From: James Hilliard <james.hilliard1@gmail.com>
-
-[ 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 <james.hilliard1@gmail.com>
-Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
-Acked-by: Jiri Olsa <jolsa@kernel.org>
-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 <sashal@kernel.org>
----
- 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
-
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
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