Skip to content

link: expose syscall wrapper symbol helper#2033

Open
arunsingh wants to merge 1 commit into
cilium:mainfrom
arunsingh:fix-kprobe-multi-syscall-wrapper
Open

link: expose syscall wrapper symbol helper#2033
arunsingh wants to merge 1 commit into
cilium:mainfrom
arunsingh:fix-kprobe-multi-syscall-wrapper

Conversation

@arunsingh

@arunsingh arunsingh commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #1891

I have exposed a small helper for deriving platform-specific syscall wrapper symbols, then use it from the kprobe_multi syscall attach test.

Kprobe/Kretprobe can retry syscall symbols with the platform prefix, but doing the same automatically for kprobe_multi is ambiguous because a multi-attach list can contain both syscall entrypoints and ordinary kernel functions. The helper lets callers opt in per symbol without changing KprobeMulti attach semantics.

Tests:

  • go test ./link -run '^TestSyscallWrapper$' -count=1
  • go test -exec sudo ./link -run '^TestKprobeMultiInput$' -count=1
  • go test -exec sudo ./link -run '^(TestKprobeMultiProgramCall|TestKprobeMulti|TestKprobeMultiErrors|TestKprobeMultiCookie)$' -count=1 -v
  • git diff --check -- link/kprobe.go link/kprobe_test.go link/kprobe_multi_test.go

Also attempted go test -exec sudo ./... in the Ubuntu VM. The focused link tests passed; the broad run hit unrelated cmd/bpf2go module-cache setup with GOPROXY=off and an unrelated features/LircMode2 kernel capability failure.

Signed-off-by: Arun Singh <arunsingh.in@gmail.com>
@arunsingh arunsingh marked this pull request as ready for review June 6, 2026 12:02
@arunsingh arunsingh requested a review from mmat11 as a code owner June 6, 2026 12:02
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.

kprobe_multi should automatically add syscall wrapper prefix if necessary

1 participant