Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: libbpf: increase probe_name buffer size to avoid format-truncation
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003347

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: b13448d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003347
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 180a46b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003347
version: 1

This patch increases the size of the `probe_name` buffer in
`probe_kern_syscall_wrapper()` from `MAX_EVENT_NAME_LEN` to
`MAX_EVENT_NAME_LEN * 2`.

The change addresses a build failure in perf builds caused by GCC's
-Werror=format-truncation warning:

  libbpf.c:11052:45: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size between 34 and 53 [-Werror=format-truncation]

The warning is triggered by a `snprintf()` call that formats a string
using syscall names and other identifiers. In some cases, the buffer
size is insufficient, leading to potential truncation.

Debug builds pass because they do not treat warnings as errors, but
perf builds fail due to `-Werror`.

Increasing the buffer size ensures that the formatted string fits
safely, resolving the issue without affecting functionality.

Signed-off-by: Sanjay Chitroda <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 6ff4a0f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003347
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1003347 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant