Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The kfunc fixup code doesn't properly close the btf.Handle if the compatibility check fails: leaked fd created at: github.com/cilium/ebpf/internal/sys.newFD+0x26 /home/lorenz/dev/ebpf/internal/sys/fd.go:23 github.com/cilium/ebpf/internal/sys.NewFD+0x24 /home/lorenz/dev/ebpf/internal/sys/fd.go:63 github.com/cilium/ebpf/internal/sys.BtfGetFdById+0x36 /home/lorenz/dev/ebpf/internal/sys/types.go:583 github.com/cilium/ebpf/btf.NewHandleFromID+0x2e /home/lorenz/dev/ebpf/btf/handle.go:83 github.com/cilium/ebpf/btf.(*HandleIterator).Next+0xa4 /home/lorenz/dev/ebpf/btf/handle.go:228 github.com/cilium/ebpf.findTargetInModule+0xc9 /home/lorenz/dev/ebpf/prog.go:965 github.com/cilium/ebpf.findTargetInKernel+0xe4 /home/lorenz/dev/ebpf/prog.go:943 github.com/cilium/ebpf.fixupKfuncs+0x3ef /home/lorenz/dev/ebpf/linker.go:284 github.com/cilium/ebpf.newProgramWithOptions+0x80d /home/lorenz/dev/ebpf/prog.go:277 github.com/cilium/ebpf.(*collectionLoader).loadProgram+0x415 /home/lorenz/dev/ebpf/collection.go:522 github.com/cilium/ebpf.NewCollectionWithOptions+0x239 /home/lorenz/dev/ebpf/collection.go:385 github.com/cilium/ebpf.NewCollection+0x44 /home/lorenz/dev/ebpf/collection.go:358 github.com/cilium/ebpf.LoadCollection+0x45 /home/lorenz/dev/ebpf/collection.go:680 github.com/cilium/ebpf.TestInvalidKfunc+0xcb /home/lorenz/dev/ebpf/elf_reader_test.go:740 testing.tRunner+0xfe /usr/local/go/src/testing/testing.go:1595 runtime.goexit+0x0 /usr/local/go/src/runtime/asm_amd64.s:1650 Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
- Loading branch information