bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesus Sanchez-Palencia <jesussanp@google.com>
To: bpf@vger.kernel.org
Cc: andrii@kernel.org, sdf@google.com, rongtao@cestc.cn,
	daniel@iogearbox.net, jesussanp@google.com
Subject: [PATCH] Revert "libbpf: Poison strlcpy()"
Date: Wed,  8 Mar 2023 16:48:36 -0800	[thread overview]
Message-ID: <20230309004836.2808610-1-jesussanp@google.com> (raw)

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


             reply	other threads:[~2023-03-09  0:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  0:48 Jesus Sanchez-Palencia [this message]
2023-03-09  1:40 ` [PATCH] Revert "libbpf: Poison strlcpy()" 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230309004836.2808610-1-jesussanp@google.com \
    --to=jesussanp@google.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=rongtao@cestc.cn \
    --cc=sdf@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).