public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "libbpf: Poison strlcpy()"
@ 2023-03-09  0:48 Jesus Sanchez-Palencia
  2023-03-09  1:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 7+ messages in thread
From: Jesus Sanchez-Palencia @ 2023-03-09  0:48 UTC (permalink / raw)
  To: bpf; +Cc: andrii, sdf, rongtao, daniel, jesussanp

This reverts commit 6d0c4b11e743("libbpf: Poison strlcpy()").

It added the pragma poison directive to libbpf_internal.h to protect
against accidental usage of strlcpy but ended up breaking the build for
toolchains based on libcs which provide the strlcpy() declaration from
string.h (e.g. uClibc-ng). The include order which causes the issue is:

    string.h,
    from Iibbpf_common.h:12,
    from libbpf.h:20,
    from libbpf_internal.h:26,
    from strset.c:9:

Signed-off-by: Jesus Sanchez-Palencia <jesussanp@google.com>
---
 tools/lib/bpf/libbpf_internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h
index fbaf68335394..e4d05662a96c 100644
--- a/tools/lib/bpf/libbpf_internal.h
+++ b/tools/lib/bpf/libbpf_internal.h
@@ -20,8 +20,8 @@
 /* make sure libbpf doesn't use kernel-only integer typedefs */
 #pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64
 
-/* prevent accidental re-addition of reallocarray()/strlcpy() */
-#pragma GCC poison reallocarray strlcpy
+/* prevent accidental re-addition of reallocarray() */
+#pragma GCC poison reallocarray
 
 #include "libbpf.h"
 #include "btf.h"
-- 
2.40.0.rc0.216.gc4246ad0f0-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-09 19:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-09  0:48 [PATCH] Revert "libbpf: Poison strlcpy()" Jesus Sanchez-Palencia
2023-03-09  1:40 ` patchwork-bot+netdevbpf
2023-03-09 16:06   ` Jesus Sanchez-Palencia
2023-03-09 17:26     ` Andrii Nakryiko
2023-03-09 17:31       ` Jesus Sanchez-Palencia
2023-03-09 18:50         ` Daniel Borkmann
2023-03-09 19:03           ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox