Skip to content

Commit

Permalink
link: accept ENOENT when trying to probe a non-existing address
Browse files Browse the repository at this point in the history
It seems like creating a kprobe_multi now returns ENOENT on newer
kernels.

Signed-off-by: Lorenz Bauer <[email protected]>
  • Loading branch information
lmb committed Feb 24, 2025
1 parent 061f55f commit c1466e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions link/kprobe_multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ func TestKprobeMultiErrors(t *testing.T) {

// Only have a negative test for addresses as it would be hard to maintain a
// proper one.
if _, err := KprobeMulti(prog, KprobeMultiOptions{
_, err = KprobeMulti(prog, KprobeMultiOptions{
Addresses: []uintptr{^uintptr(0)},
}); !errors.Is(err, unix.EINVAL) {
t.Fatalf("expected EINVAL, got: %s", err)
})
if !errors.Is(err, os.ErrNotExist) && !errors.Is(err, unix.EINVAL) {
t.Fatalf("expected ErrNotExist or EINVAL, got: %s", err)
}
}

Expand Down

0 comments on commit c1466e0

Please sign in to comment.