Skip to contentSkip to conversation

Revert "libbpf: Poison strlcpy()"

PATCH Applied Jesus Sanchez-Palencia 4 participants 7 messages Mar 9, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "libbpf: Poison strlcpy()"

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:
---
 tools/lib/bpf/libbpf_internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/bpf/libbpf_internal.h +2 -2
index fbaf68335394..e4d05662a96c 100644
@@ -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"
Signature · 1 line
2.40.0.rc0.216.gc4246ad0f0-goog
#1 lore raw
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Quoted 8 lines · On Wed, 8 Mar 2023 16:48:36 -0800 you wrote:

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:

[...]

Here is the summary with links:
- Revert "libbpf: Poison strlcpy()"

    https://git.kernel.org/bpf/bpf-next/c/3b83591e32dd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#2 lore raw
Quoted 5 lines · On Wed, Mar 8, 2023 at 5:40 PM <[email protected]> wrote:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Andrii, are you planning to send this patch to 6.3-rc* since the build is broken there?
Just double-checking since it was applied to bpf-next.

Thanks,
Jesus

#3 lore raw
Quoted 11 lines · Jesus Sanchez-Palencia
Quoted 5 lines · On Wed, Mar 8, 2023 at 5:40 PM <[email protected]> wrote:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Andrii, are you planning to send this patch to 6.3-rc* since the build is broken there?
Just double-checking since it was applied to bpf-next.

I didn't intend to, feel free to do that.

But just curious, why are you building libbpf from kernel sources instead of Github repo? Is it through perf build?

Quoted 3 lines

Thanks,
Jesus

#4 lore raw
Quoted 8 lines · Andrii Nakryiko
Quoted 5 lines · Jesus Sanchez-Palencia
Quoted 3 lines · On Wed, Mar 8, 2023 at 5:40 PM <[email protected]> wrote:

Hello:

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Andrii, are you planning to send this patch to 6.3-rc* since the build is broken there?
Just double-checking since it was applied to bpf-next.

I didn't intend to, feel free to do that.

Oh I always thought that fixes for the rc-* iterations had to come from the maintainer
trees. Should I just send it to lkml directly?

Quoted 3 lines

But just curious, why are you building libbpf from kernel sources instead of Github repo? Is it through perf build?

Yes, through the perf build. We build it altogether as part of our kernel build.

Thanks,
Jesus

maintainer
#5 lore raw
Quoted 17 lines · Jesus Sanchez-Palencia
Quoted 6 lines · Andrii Nakryiko
Quoted 4 lines · Jesus Sanchez-Palencia
Quoted 3 lines · On Wed, Mar 8, 2023 at 5:40 PM <[email protected]> wrote:

Hello:

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Andrii, are you planning to send this patch to 6.3-rc* since the build is broken there?
Just double-checking since it was applied to bpf-next.

I didn't intend to, feel free to do that.

Quoted 8 lines

Oh I always thought that fixes for the rc-* iterations had to come from the maintainer
trees. Should I just send it to lkml directly?

Quoted 2 lines

But just curious, why are you building libbpf from kernel sources instead of Github repo? Is it through perf build?

Yes, through the perf build. We build it altogether as part of our kernel build.

Ok, just moved over to bpf tree in that case where it will land in -rc's.

Thanks,
Daniel

#6 lore raw
Quoted 23 lines · Daniel Borkmann
Quoted 21 lines · Jesus Sanchez-Palencia
Quoted 6 lines · Andrii Nakryiko
Quoted 4 lines · Jesus Sanchez-Palencia
Quoted 3 lines · On Wed, Mar 8, 2023 at 5:40 PM <[email protected]> wrote:

Hello:

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Andrii, are you planning to send this patch to 6.3-rc* since the build is broken there?
Just double-checking since it was applied to bpf-next.

I didn't intend to, feel free to do that.

Oh I always thought that fixes for the rc-* iterations had to come from the maintainer
trees. Should I just send it to lkml directly?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

But just curious, why are you building libbpf from kernel sources instead of Github repo? Is it through perf build?

Yes, through the perf build. We build it altogether as part of our kernel build.

Ok, just moved over to bpf tree in that case where it will land in -rc's.

Thanks, Daniel, for taking care of this!

Quoted 2 lines

Thanks,
Daniel