[PATCH v4 09/42] bpf: use rte strerror

Dengdui Huang huangdengdui at huawei.com
Wed Oct 23 10:28:19 CEST 2024


The function strerror() is insecure in a multi-thread environment.
This patch uses rte_strerror() to replace it.

Cc: stable at dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
---
 lib/bpf/bpf_load_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bpf/bpf_load_elf.c b/lib/bpf/bpf_load_elf.c
index e0abd3c856..fb3c18cb5f 100644
--- a/lib/bpf/bpf_load_elf.c
+++ b/lib/bpf/bpf_load_elf.c
@@ -310,7 +310,7 @@ rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname,
 	if (fd < 0) {
 		rc = errno;
 		RTE_BPF_LOG_LINE(ERR, "%s(%s) error code: %d(%s)",
-			__func__, fname, rc, strerror(rc));
+			__func__, fname, rc, rte_strerror(rc));
 		rte_errno = EINVAL;
 		return NULL;
 	}
-- 
2.33.0



More information about the dev mailing list