Skip to content

Properly zero initialize uprobe opts sz member #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2023
Merged

Properly zero initialize uprobe opts sz member #450

merged 2 commits into from
May 15, 2023

Conversation

danielocfb
Copy link
Collaborator

@danielocfb danielocfb commented May 15, 2023

This change fixes the sz member initialization of bpf_uprobe_opts objects that we use in the uprobe attach code. The previously incorrect size could lead to libbpf failing the attachment on optimized builds, where the size of Program objects was different to dev ones.

Fixes: #447

d-e-s-o added 2 commits May 15, 2023 12:57
This change fixes the sz member initialization of bpf_uprobe_opts
objects that we use in the uprobe attach code. The previously incorrect
size could lead to libbpf failing the attachment on optimized builds,
where the size of Program objects was different to dev ones.

Fixes: #447
Signed-off-by: Daniel Müller <[email protected]>
Run tests on release builds to catch issues such as #447 early on.

Signed-off-by: Daniel Müller <[email protected]>
@danielocfb danielocfb requested a review from anakryiko May 15, 2023 20:03
Copy link
Member

@anakryiko anakryiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice find!

@danielocfb danielocfb merged commit 208d02e into libbpf:master May 15, 2023
@danielocfb danielocfb deleted the topic/fix-opts-init-padding branch May 15, 2023 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Program::attach_uprobe_with_opts() fails when building with --release
3 participants