Skip to content
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

link: make KprobeMultiOptions.Addresses a []uintptr #913

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Jan 22, 2023

The kernel expects kprobe_multi.addrs to point at an array of unsigned long. The size of unsigned long is compiler or platform dependent, so using uint64 is incorrect on 32-bit arches.

uintptr seems like the closest analog to C's unsigned long, although I've not been able to figure out how uintptr is really defined.

See https://elixir.bootlin.com/linux/v6.1.7/source/kernel/trace/bpf_trace.c#L2671

Signed-off-by: Lorenz Bauer oss@lmb.io

The kernel expects kprobe_multi.addrs to point at an array of
unsigned long. The size of unsigned long is compiler or
platform dependent, so using uint64 is incorrect on 32-bit arches.

uintptr seems like the closest analog to C's unsigned long, although
I've not been able to figure out how uintptr is really defined.

See https://elixir.bootlin.com/linux/v6.1.7/source/kernel/trace/bpf_trace.c#L2671

Signed-off-by: Lorenz Bauer <oss@lmb.io>
@lmb lmb requested a review from mmat11 January 22, 2023 19:48
@lmb lmb merged commit c89e687 into cilium:master Jan 23, 2023
@lmb lmb deleted the link-fix-kprobe-multi-addrs branch January 23, 2023 15:48
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.

2 participants