diff --git a/internal/sys/syscall.go b/internal/sys/syscall.go index 6dde23075..3205ede80 100644 --- a/internal/sys/syscall.go +++ b/internal/sys/syscall.go @@ -17,6 +17,13 @@ var ENOTSUPP = syscall.Errno(524) // // Any pointers contained in attr must use the Pointer type from this package. func BPF(cmd Cmd, attr unsafe.Pointer, size uintptr) (uintptr, error) { + // Prevent the Go profiler from repeatedly interrupting the verifier, + // which could otherwise lead to a livelock due to receiving EAGAIN. + if cmd == BPF_PROG_LOAD { + maskProfilerSignal() + defer unmaskProfilerSignal() + } + for { r1, _, errNo := unix.Syscall(unix.SYS_BPF, uintptr(cmd), uintptr(attr), size) runtime.KeepAlive(attr)