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

Message ID 20241023082852.2780488-10-huangdengdui@huawei.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers
Series replace strerror |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

huangdengdui Oct. 23, 2024, 8:28 a.m. UTC
The function strerror() is insecure in a multi-thread environment.
This patch uses rte_strerror() to replace it.

Cc: stable@dpdk.org

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

Patch

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;
 	}