From ee1bdb80af42afbf184a435d98bb249a039b3b3b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 19 Nov 2020 12:06:48 +0100 Subject: [PATCH] vendor: github.com/cilium/ebpf v0.2.0 full diff: https://github.com/cilium/ebpf/compare/v0.1.0...v0.2.0 - btf: add go-fuzz targets - btf: avoid Type copy in FuncProto.walk - btf: check err in loadSpecFromVmlinux - btf: handle type name flavours - CI: test on 5.9 kernel - cmd/bpf2go: output ELF .o next to the .go file - link: add AttachSkLookup - Remove two unused functions - Support LSM attach - use buffered I/O to cut down on read syscalls - Various doc link fixes Signed-off-by: Sebastiaan van Stijn --- go.mod | 2 +- go.sum | 4 +- vendor/github.com/cilium/ebpf/abi.go | 6 --- vendor/github.com/cilium/ebpf/elf_reader.go | 8 +-- .../cilium/ebpf/internal/btf/btf.go | 14 ++++-- .../cilium/ebpf/internal/btf/ext_info.go | 12 ++++- .../cilium/ebpf/internal/btf/fuzz.go | 49 +++++++++++++++++++ .../cilium/ebpf/internal/btf/types.go | 40 ++++++++++----- .../cilium/ebpf/internal/feature.go | 8 +++ .../cilium/ebpf/internal/syscall.go | 27 ++++++++++ vendor/github.com/cilium/ebpf/map.go | 2 +- vendor/github.com/cilium/ebpf/prog.go | 26 ++++++++-- vendor/github.com/cilium/ebpf/readme.md | 3 +- vendor/github.com/cilium/ebpf/run-tests.sh | 7 +-- vendor/github.com/cilium/ebpf/syscalls.go | 29 +---------- vendor/modules.txt | 2 +- 16 files changed, 173 insertions(+), 66 deletions(-) create mode 100644 vendor/github.com/cilium/ebpf/internal/btf/fuzz.go diff --git a/go.mod b/go.mod index 22c9fbd52..517ecc102 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.14 require ( github.com/checkpoint-restore/go-criu/v4 v4.1.0 - github.com/cilium/ebpf v0.1.0 + github.com/cilium/ebpf v0.2.0 github.com/containerd/console v1.0.1 github.com/coreos/go-systemd/v22 v22.1.0 github.com/cyphar/filepath-securejoin v0.2.2 diff --git a/go.sum b/go.sum index 319f0793c..99cd4029b 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/checkpoint-restore/go-criu/v4 v4.1.0 h1:WW2B2uxx9KWF6bGlHqhm8Okiafwwx7Y2kcpn8lCpjgo= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/cilium/ebpf v0.1.0 h1:x/yQklFd+2dSQXS077Yn5nHkQ1+xXPP21HpjXyPEKF0= -github.com/cilium/ebpf v0.1.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= +github.com/cilium/ebpf v0.2.0 h1:Fv93L3KKckEcEHR3oApXVzyBTDA8WAm6VXhPE00N3f8= +github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/containerd/console v1.0.1 h1:u7SFAJyRqWcG6ogaMAx3KjSTy1e3hT9QxqX7Jco7dRc= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg= diff --git a/vendor/github.com/cilium/ebpf/abi.go b/vendor/github.com/cilium/ebpf/abi.go index d432eb46f..f86a17ee7 100644 --- a/vendor/github.com/cilium/ebpf/abi.go +++ b/vendor/github.com/cilium/ebpf/abi.go @@ -88,12 +88,6 @@ type ProgramABI struct { Type ProgramType } -func newProgramABIFromSpec(spec *ProgramSpec) *ProgramABI { - return &ProgramABI{ - spec.Type, - } -} - func newProgramABIFromFd(fd *internal.FD) (string, *ProgramABI, error) { info, err := bpfGetProgInfoByFD(fd) if err != nil { diff --git a/vendor/github.com/cilium/ebpf/elf_reader.go b/vendor/github.com/cilium/ebpf/elf_reader.go index 6dcd14a81..2b564dae0 100644 --- a/vendor/github.com/cilium/ebpf/elf_reader.go +++ b/vendor/github.com/cilium/ebpf/elf_reader.go @@ -1,6 +1,7 @@ package ebpf import ( + "bufio" "bytes" "debug/elf" "encoding/binary" @@ -236,7 +237,7 @@ func (ec *elfCode) loadPrograms(progSections map[elf.SectionIndex]*elf.Section, func (ec *elfCode) loadInstructions(section *elf.Section, symbols, relocations map[uint64]elf.Symbol) (asm.Instructions, uint64, error) { var ( - r = section.Open() + r = bufio.NewReader(section.Open()) insns asm.Instructions offset uint64 ) @@ -389,7 +390,7 @@ func (ec *elfCode) loadMaps(maps map[string]*MapSpec, mapSections map[elf.Sectio } var ( - r = sec.Open() + r = bufio.NewReader(sec.Open()) size = sec.Size / uint64(len(syms)) ) for i, offset := 0, uint64(0); i < len(syms); i, offset = i+1, offset+size { @@ -638,6 +639,7 @@ func getProgType(sectionName string) (ProgramType, AttachType, string) { "flow_dissector": {FlowDissector, AttachFlowDissector}, "iter/": {Tracing, AttachTraceIter}, "sk_lookup/": {SkLookup, AttachSkLookup}, + "lsm/": {LSM, AttachLSMMac}, "cgroup_skb/ingress": {CGroupSKB, AttachCGroupInetIngress}, "cgroup_skb/egress": {CGroupSKB, AttachCGroupInetEgress}, @@ -686,7 +688,7 @@ func (ec *elfCode) loadRelocations(sections map[elf.SectionIndex]*elf.Section) ( return nil, nil, fmt.Errorf("section %s: relocations are less than 16 bytes", sec.Name) } - r := sec.Open() + r := bufio.NewReader(sec.Open()) for off := uint64(0); off < sec.Size; off += sec.Entsize { ent := io.LimitReader(r, int64(sec.Entsize)) diff --git a/vendor/github.com/cilium/ebpf/internal/btf/btf.go b/vendor/github.com/cilium/ebpf/internal/btf/btf.go index 5e4a9582d..7a904a02c 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/btf.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/btf.go @@ -31,7 +31,7 @@ var ( type Spec struct { rawTypes []rawType strings stringTable - types map[string][]Type + types map[string][]namedType funcInfos map[string]extInfo lineInfos map[string]extInfo byteOrder binary.ByteOrder @@ -145,6 +145,9 @@ func loadSpecFromVmlinux(rd io.ReaderAt) (*Spec, error) { defer file.Close() btfSection, _, _, err := findBtfSections(file) + if err != nil { + return nil, fmt.Errorf(".BTF ELF section: %s", err) + } if btfSection == nil { return nil, fmt.Errorf("unable to find .BTF ELF section") } @@ -234,7 +237,7 @@ func loadKernelSpec() (*Spec, error) { return loadSpecFromVmlinux(fh) } - return nil, fmt.Errorf("BTF for kernel version %s: %w", release, ErrNotFound) + return nil, fmt.Errorf("no BTF for kernel version %s: %w", release, internal.ErrNotSupported) } func parseBTF(btf io.ReadSeeker, bo binary.ByteOrder) ([]rawType, stringTable, error) { @@ -500,11 +503,16 @@ func (s *Spec) FindType(name string, typ Type) error { candidate Type ) - for _, typ := range s.types[name] { + for _, typ := range s.types[essentialName(name)] { if reflect.TypeOf(typ) != wanted { continue } + // Match against the full name, not just the essential one. + if typ.name() != name { + continue + } + if candidate != nil { return fmt.Errorf("type %s: multiple candidates for %T", name, typ) } diff --git a/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go b/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go index 28918ae9e..c1c82ec7f 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go @@ -1,6 +1,7 @@ package btf import ( + "bufio" "bytes" "encoding/binary" "errors" @@ -58,7 +59,8 @@ func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (f return nil, nil, fmt.Errorf("can't seek to function info section: %v", err) } - funcInfo, err = parseExtInfo(io.LimitReader(r, int64(header.FuncInfoLen)), bo, strings) + buf := bufio.NewReader(io.LimitReader(r, int64(header.FuncInfoLen))) + funcInfo, err = parseExtInfo(buf, bo, strings) if err != nil { return nil, nil, fmt.Errorf("function info: %w", err) } @@ -67,7 +69,8 @@ func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (f return nil, nil, fmt.Errorf("can't seek to line info section: %v", err) } - lineInfo, err = parseExtInfo(io.LimitReader(r, int64(header.LineInfoLen)), bo, strings) + buf = bufio.NewReader(io.LimitReader(r, int64(header.LineInfoLen))) + lineInfo, err = parseExtInfo(buf, bo, strings) if err != nil { return nil, nil, fmt.Errorf("line info: %w", err) } @@ -127,6 +130,8 @@ func (ei extInfo) MarshalBinary() ([]byte, error) { } func parseExtInfo(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[string]extInfo, error) { + const maxRecordSize = 256 + var recordSize uint32 if err := binary.Read(r, bo, &recordSize); err != nil { return nil, fmt.Errorf("can't read record size: %v", err) @@ -136,6 +141,9 @@ func parseExtInfo(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[st // Need at least insnOff return nil, errors.New("record size too short") } + if recordSize > maxRecordSize { + return nil, fmt.Errorf("record size %v exceeds %v", recordSize, maxRecordSize) + } result := make(map[string]extInfo) for { diff --git a/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go b/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go new file mode 100644 index 000000000..37e043fd3 --- /dev/null +++ b/vendor/github.com/cilium/ebpf/internal/btf/fuzz.go @@ -0,0 +1,49 @@ +// +build gofuzz + +// Use with https://github.com/dvyukov/go-fuzz + +package btf + +import ( + "bytes" + "encoding/binary" + + "github.com/cilium/ebpf/internal" +) + +func FuzzSpec(data []byte) int { + if len(data) < binary.Size(btfHeader{}) { + return -1 + } + + spec, err := loadNakedSpec(bytes.NewReader(data), internal.NativeEndian, nil, nil) + if err != nil { + if spec != nil { + panic("spec is not nil") + } + return 0 + } + if spec == nil { + panic("spec is nil") + } + return 1 +} + +func FuzzExtInfo(data []byte) int { + if len(data) < binary.Size(btfExtHeader{}) { + return -1 + } + + table := stringTable("\x00foo\x00barfoo\x00") + info, err := parseExtInfo(bytes.NewReader(data), internal.NativeEndian, table) + if err != nil { + if info != nil { + panic("info is not nil") + } + return 0 + } + if info == nil { + panic("info is nil") + } + return 1 +} diff --git a/vendor/github.com/cilium/ebpf/internal/btf/types.go b/vendor/github.com/cilium/ebpf/internal/btf/types.go index 8db5b66b1..a93039bd5 100644 --- a/vendor/github.com/cilium/ebpf/internal/btf/types.go +++ b/vendor/github.com/cilium/ebpf/internal/btf/types.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "math" + "strings" ) const maxTypeDepth = 32 @@ -28,6 +29,14 @@ type Type interface { walk(*copyStack) } +// namedType is a type with a name. +// +// Most named types simply embed Name. +type namedType interface { + Type + name() string +} + // Name identifies a type. // // Anonymous types have an empty name. @@ -67,6 +76,8 @@ type Int struct { Bits byte } +var _ namedType = (*Int)(nil) + func (i *Int) size() uint32 { return i.Size } func (i *Int) walk(*copyStack) {} func (i *Int) copy() Type { @@ -286,8 +297,8 @@ type FuncProto struct { func (fp *FuncProto) walk(cs *copyStack) { cs.push(&fp.Return) - for _, m := range fp.Params { - cs.push(&m.Type) + for i := range fp.Params { + cs.push(&fp.Params[i].Type) } } @@ -469,19 +480,13 @@ func (cs *copyStack) pop() *Type { return t } -type namer interface { - name() string -} - -var _ namer = Name("") - // inflateRawTypes takes a list of raw btf types linked via type IDs, and turns // it into a graph of Types connected via pointers. // // Returns a map of named types (so, where NameOff is non-zero). Since BTF ignores // compilation units, multiple types may share the same name. A Type may form a // cyclic graph by pointing at itself. -func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map[string][]Type, err error) { +func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map[string][]namedType, err error) { type fixupDef struct { id TypeID expectedKind btfKind @@ -520,7 +525,7 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map types := make([]Type, 0, len(rawTypes)) types = append(types, (*Void)(nil)) - namedTypes = make(map[string][]Type) + namedTypes = make(map[string][]namedType) for i, raw := range rawTypes { var ( @@ -656,9 +661,9 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map types = append(types, typ) - if namer, ok := typ.(namer); ok { - if name := namer.name(); name != "" { - namedTypes[name] = append(namedTypes[name], typ) + if named, ok := typ.(namedType); ok { + if name := essentialName(named.name()); name != "" { + namedTypes[name] = append(namedTypes[name], named) } } } @@ -684,3 +689,12 @@ func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map return namedTypes, nil } + +// essentialName returns name without a ___ suffix. +func essentialName(name string) string { + lastIdx := strings.LastIndex(name, "___") + if lastIdx > 0 { + return name[:lastIdx] + } + return name +} diff --git a/vendor/github.com/cilium/ebpf/internal/feature.go b/vendor/github.com/cilium/ebpf/internal/feature.go index 7375b21ef..8f282db64 100644 --- a/vendor/github.com/cilium/ebpf/internal/feature.go +++ b/vendor/github.com/cilium/ebpf/internal/feature.go @@ -20,6 +20,9 @@ type UnsupportedFeatureError struct { } func (ufe *UnsupportedFeatureError) Error() string { + if ufe.MinimumVersion.Unspecified() { + return fmt.Sprintf("%s not supported", ufe.Name) + } return fmt.Sprintf("%s not supported (requires >= %s)", ufe.Name, ufe.MinimumVersion) } @@ -120,3 +123,8 @@ func (v Version) Less(other Version) bool { } return false } + +// Unspecified returns true if the version is all zero. +func (v Version) Unspecified() bool { + return v[0] == 0 && v[1] == 0 && v[2] == 0 +} diff --git a/vendor/github.com/cilium/ebpf/internal/syscall.go b/vendor/github.com/cilium/ebpf/internal/syscall.go index efbf40327..9c5e0b3ed 100644 --- a/vendor/github.com/cilium/ebpf/internal/syscall.go +++ b/vendor/github.com/cilium/ebpf/internal/syscall.go @@ -137,3 +137,30 @@ func BPFObjGet(fileName string) (*FD, error) { } return NewFD(uint32(ptr)), nil } + +type bpfObjGetInfoByFDAttr struct { + fd uint32 + infoLen uint32 + info Pointer +} + +// BPFObjGetInfoByFD wraps BPF_OBJ_GET_INFO_BY_FD. +// +// Available from 4.13. +func BPFObjGetInfoByFD(fd *FD, info unsafe.Pointer, size uintptr) error { + value, err := fd.Value() + if err != nil { + return err + } + + attr := bpfObjGetInfoByFDAttr{ + fd: value, + infoLen: uint32(size), + info: NewPointer(info), + } + _, err = BPF(BPF_OBJ_GET_INFO_BY_FD, unsafe.Pointer(&attr), unsafe.Sizeof(attr)) + if err != nil { + return fmt.Errorf("fd %v: %w", fd, err) + } + return nil +} diff --git a/vendor/github.com/cilium/ebpf/map.go b/vendor/github.com/cilium/ebpf/map.go index bb87977e4..5c9028d9d 100644 --- a/vendor/github.com/cilium/ebpf/map.go +++ b/vendor/github.com/cilium/ebpf/map.go @@ -664,7 +664,7 @@ func (m *Map) Clone() (*Map, error) { // Pin persists the map past the lifetime of the process that created it. // -// This requires bpffs to be mounted above fileName. See http://cilium.readthedocs.io/en/doc-1.0/kubernetes/install/#mounting-the-bpf-fs-optional +// This requires bpffs to be mounted above fileName. See https://docs.cilium.io/en/k8s-doc/admin/#admin-mount-bpffs func (m *Map) Pin(fileName string) error { return internal.BPFObjPin(fileName, m.fd) } diff --git a/vendor/github.com/cilium/ebpf/prog.go b/vendor/github.com/cilium/ebpf/prog.go index bb38f2154..67cfff67e 100644 --- a/vendor/github.com/cilium/ebpf/prog.go +++ b/vendor/github.com/cilium/ebpf/prog.go @@ -322,7 +322,7 @@ func (p *Program) Clone() (*Program, error) { // Pin persists the Program past the lifetime of the process that created it // -// This requires bpffs to be mounted above fileName. See http://cilium.readthedocs.io/en/doc-1.0/kubernetes/install/#mounting-the-bpf-fs-optional +// This requires bpffs to be mounted above fileName. See https://docs.cilium.io/en/k8s-doc/admin/#admin-mount-bpffs func (p *Program) Pin(fileName string) error { if err := internal.BPFObjPin(fileName, p.fd); err != nil { return fmt.Errorf("can't pin program: %w", err) @@ -626,10 +626,30 @@ func resolveBTFType(name string, progType ProgramType, attachType AttachType) (b target := match{progType, attachType} switch target { + case match{LSM, AttachLSMMac}: + var target btf.Func + err := findKernelType("bpf_lsm_"+name, &target) + if errors.Is(err, btf.ErrNotFound) { + return nil, &internal.UnsupportedFeatureError{ + Name: name + " LSM hook", + } + } + if err != nil { + return nil, fmt.Errorf("resolve BTF for LSM hook %s: %w", name, err) + } + + return &target, nil + case match{Tracing, AttachTraceIter}: var target btf.Func - if err := findKernelType("bpf_iter_"+name, &target); err != nil { - return nil, fmt.Errorf("can't resolve BTF for iterator %s: %w", name, err) + err := findKernelType("bpf_iter_"+name, &target) + if errors.Is(err, btf.ErrNotFound) { + return nil, &internal.UnsupportedFeatureError{ + Name: name + " iterator", + } + } + if err != nil { + return nil, fmt.Errorf("resolve BTF for iterator %s: %w", name, err) } return &target, nil diff --git a/vendor/github.com/cilium/ebpf/readme.md b/vendor/github.com/cilium/ebpf/readme.md index 0c6614bb4..298db57c3 100644 --- a/vendor/github.com/cilium/ebpf/readme.md +++ b/vendor/github.com/cilium/ebpf/readme.md @@ -23,6 +23,7 @@ right now**. Expect to update your code if you want to follow along. ## Useful resources -* [Cilium eBPF documentation](https://cilium.readthedocs.io/en/latest/bpf/#bpf-guide) (recommended) +* [eBPF.io](https://ebpf.io) (recommended) +* [Cilium eBPF documentation](https://docs.cilium.io/en/latest/bpf/#bpf-guide) (recommended) * [Linux documentation on BPF](http://elixir.free-electrons.com/linux/latest/source/Documentation/networking/filter.txt) * [eBPF features by Linux version](https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md) diff --git a/vendor/github.com/cilium/ebpf/run-tests.sh b/vendor/github.com/cilium/ebpf/run-tests.sh index 3a2759478..bd349f951 100644 --- a/vendor/github.com/cilium/ebpf/run-tests.sh +++ b/vendor/github.com/cilium/ebpf/run-tests.sh @@ -12,7 +12,8 @@ if [[ "${1:-}" = "--in-vm" ]]; then export CGO_ENABLED=0 export GOFLAGS=-mod=readonly export GOPATH=/run/go-path - export GOPROXY=file:///run/go-root/pkg/mod/cache/download + export GOPROXY=file:///run/go-path/pkg/mod/cache/download + export GOSUMDB=off export GOCACHE=/run/go-cache elfs="" @@ -22,8 +23,8 @@ if [[ "${1:-}" = "--in-vm" ]]; then echo Running tests... # TestLibBPFCompat runs separately to pass the "-elfs" flag only for it: https://github.com/cilium/ebpf/pull/119 - go test -v -run TestLibBPFCompat -elfs "$elfs" - go test -v ./... + go test -v -count 1 -run TestLibBPFCompat -elfs "$elfs" + go test -v -count 1 ./... touch "$1/success" exit 0 fi diff --git a/vendor/github.com/cilium/ebpf/syscalls.go b/vendor/github.com/cilium/ebpf/syscalls.go index ab66edc1d..ff5c8e6c3 100644 --- a/vendor/github.com/cilium/ebpf/syscalls.go +++ b/vendor/github.com/cilium/ebpf/syscalls.go @@ -129,12 +129,6 @@ type bpfProgTestRunAttr struct { duration uint32 } -type bpfObjGetInfoByFDAttr struct { - fd uint32 - infoLen uint32 - info internal.Pointer // May be either bpfMapInfo or bpfProgInfo -} - type bpfGetFDByIDAttr struct { id uint32 next uint32 @@ -353,28 +347,9 @@ func bpfMapFreeze(m *internal.FD) error { return err } -func bpfGetObjectInfoByFD(fd *internal.FD, info unsafe.Pointer, size uintptr) error { - value, err := fd.Value() - if err != nil { - return err - } - - // available from 4.13 - attr := bpfObjGetInfoByFDAttr{ - fd: value, - infoLen: uint32(size), - info: internal.NewPointer(info), - } - _, err = internal.BPF(internal.BPF_OBJ_GET_INFO_BY_FD, unsafe.Pointer(&attr), unsafe.Sizeof(attr)) - if err != nil { - return fmt.Errorf("fd %v: %w", fd, err) - } - return nil -} - func bpfGetProgInfoByFD(fd *internal.FD) (*bpfProgInfo, error) { var info bpfProgInfo - if err := bpfGetObjectInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)); err != nil { + if err := internal.BPFObjGetInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)); err != nil { return nil, fmt.Errorf("can't get program info: %w", err) } return &info, nil @@ -382,7 +357,7 @@ func bpfGetProgInfoByFD(fd *internal.FD) (*bpfProgInfo, error) { func bpfGetMapInfoByFD(fd *internal.FD) (*bpfMapInfo, error) { var info bpfMapInfo - err := bpfGetObjectInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)) + err := internal.BPFObjGetInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)) if err != nil { return nil, fmt.Errorf("can't get map info: %w", err) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 1a9b61c01..590eb4ba4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2,7 +2,7 @@ ## explicit github.com/checkpoint-restore/go-criu/v4 github.com/checkpoint-restore/go-criu/v4/rpc -# github.com/cilium/ebpf v0.1.0 +# github.com/cilium/ebpf v0.2.0 ## explicit github.com/cilium/ebpf github.com/cilium/ebpf/asm