From 828e4ad89d25828f098894c4dc4f2b287af57088 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Fri, 8 May 2020 07:09:25 +0100 Subject: [PATCH] epbf: update github.com/cilium/ebpf Update ebpf to include PR https://github.com/cilium/ebpf/pull/91. The update is needed to fix #2316. Signed-off-by: Alice Frosi --- go.mod | 2 +- go.sum | 2 ++ .../github.com/cilium/ebpf/asm/instruction.go | 19 ++++++++++++++++--- .../cilium/ebpf/internal/unix/types_linux.go | 1 + .../cilium/ebpf/internal/unix/types_other.go | 1 + vendor/github.com/cilium/ebpf/run-tests.sh | 2 +- vendor/modules.txt | 2 +- 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index a7472228..56beebfc 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.14 require ( github.com/checkpoint-restore/go-criu v0.0.0-20191125063657-fcdcd07065c5 - github.com/cilium/ebpf v0.0.0-20200319110858-a7172c01168f + github.com/cilium/ebpf v0.0.0-20200507155900-a9f01edf17e3 github.com/containerd/console v1.0.0 github.com/coreos/go-systemd/v22 v22.0.0 github.com/cyphar/filepath-securejoin v0.2.2 diff --git a/go.sum b/go.sum index 55f649cf..3e71b19d 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/checkpoint-restore/go-criu v0.0.0-20191125063657-fcdcd07065c5 h1:950d github.com/checkpoint-restore/go-criu v0.0.0-20191125063657-fcdcd07065c5/go.mod h1:TrMrLQfeENAPYPRsJuq3jsqdlRh3lvi6trTZJG8+tho= github.com/cilium/ebpf v0.0.0-20200319110858-a7172c01168f h1:W1RQPz3nR8RxUw/Uqk71GU3JlZ7pNa1pXrHs98h0o9U= github.com/cilium/ebpf v0.0.0-20200319110858-a7172c01168f/go.mod h1:XT+cAw5wfvsodedcijoh1l9cf7v1x9FlFB/3VmF/O8s= +github.com/cilium/ebpf v0.0.0-20200507155900-a9f01edf17e3 h1:qcqzLJa2xCo9sgdCzpT/SJSYxROTEstuhf7ZBHMirms= +github.com/cilium/ebpf v0.0.0-20200507155900-a9f01edf17e3/go.mod h1:XT+cAw5wfvsodedcijoh1l9cf7v1x9FlFB/3VmF/O8s= github.com/containerd/console v1.0.0 h1:fU3UuQapBs+zLJu82NhR11Rif1ny2zfMMAyPJzSN5tQ= github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQamW5YV28= diff --git a/vendor/github.com/cilium/ebpf/asm/instruction.go b/vendor/github.com/cilium/ebpf/asm/instruction.go index 644de428..8058c157 100644 --- a/vendor/github.com/cilium/ebpf/asm/instruction.go +++ b/vendor/github.com/cilium/ebpf/asm/instruction.go @@ -3,6 +3,7 @@ package asm import ( "encoding/binary" "fmt" + "github.com/cilium/ebpf/internal" "io" "math" "strings" @@ -433,15 +434,27 @@ type bpfInstruction struct { type bpfRegisters uint8 func newBPFRegisters(dst, src Register) bpfRegisters { - return bpfRegisters((src << 4) | (dst & 0xF)) + if internal.NativeEndian == binary.LittleEndian { + return bpfRegisters((src << 4) | (dst & 0xF)) + } else { + return bpfRegisters((dst << 4) | (src & 0xF)) + } } func (r bpfRegisters) Dst() Register { - return Register(r & 0xF) + if internal.NativeEndian == binary.LittleEndian { + return Register(r & 0xF) + }else { + return Register(r >> 4) + } } func (r bpfRegisters) Src() Register { - return Register(r >> 4) + if internal.NativeEndian == binary.LittleEndian { + return Register(r >> 4) + } else { + return Register(r & 0xf) + } } type unreferencedSymbolError struct { diff --git a/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go b/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go index 7efbbd72..89baae2b 100644 --- a/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go +++ b/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go @@ -36,6 +36,7 @@ const ( PERF_SAMPLE_RAW = linux.PERF_SAMPLE_RAW PERF_FLAG_FD_CLOEXEC = linux.PERF_FLAG_FD_CLOEXEC RLIM_INFINITY = linux.RLIM_INFINITY + RLIMIT_MEMLOCK = linux.RLIMIT_MEMLOCK ) // Statfs_t is a wrapper diff --git a/vendor/github.com/cilium/ebpf/internal/unix/types_other.go b/vendor/github.com/cilium/ebpf/internal/unix/types_other.go index 7961b356..8fc8e77a 100644 --- a/vendor/github.com/cilium/ebpf/internal/unix/types_other.go +++ b/vendor/github.com/cilium/ebpf/internal/unix/types_other.go @@ -38,6 +38,7 @@ const ( PERF_SAMPLE_RAW = 0x400 PERF_FLAG_FD_CLOEXEC = 0x8 RLIM_INFINITY = 0x7fffffffffffffff + RLIMIT_MEMLOCK = 8 ) // Statfs_t is a wrapper diff --git a/vendor/github.com/cilium/ebpf/run-tests.sh b/vendor/github.com/cilium/ebpf/run-tests.sh index daac404c..e60c35e2 100644 --- a/vendor/github.com/cilium/ebpf/run-tests.sh +++ b/vendor/github.com/cilium/ebpf/run-tests.sh @@ -44,7 +44,7 @@ readonly tmp_dir="${TMPDIR:-$(mktemp -d)}" test -e "${tmp_dir}/${kernel}" || { echo Fetching "${kernel}" - curl --fail -L "https://github.com/newtools/ci-kernels/blob/master/${kernel}?raw=true" -o "${tmp_dir}/${kernel}" + curl --fail -L "https://github.com/cilium/ci-kernels/blob/master/${kernel}?raw=true" -o "${tmp_dir}/${kernel}" } echo Testing on "${kernel_version}" diff --git a/vendor/modules.txt b/vendor/modules.txt index 15358296..457f6644 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,7 +1,7 @@ # github.com/checkpoint-restore/go-criu v0.0.0-20191125063657-fcdcd07065c5 ## explicit github.com/checkpoint-restore/go-criu/rpc -# github.com/cilium/ebpf v0.0.0-20200319110858-a7172c01168f +# github.com/cilium/ebpf v0.0.0-20200507155900-a9f01edf17e3 ## explicit github.com/cilium/ebpf github.com/cilium/ebpf/asm