From 7bb1e38de34a221c1c193b8b04156135efa2d189 Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Wed, 23 May 2018 11:20:12 +0200 Subject: [PATCH] ebpf: update check for known faulty Ubuntu kernels With c75700fe04251b6d93240fb36ec423ed22b5d59d we added code to detect Ubuntu Xenial kernels with a regression in the eBPF subsystem in order to gently fallback to procfs scanning on such systems (and not crash the host system by running eBPF code). With the latest kernel update for Ubuntu Xenial, the bug was fixed: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1763454 Therefore we can update the added check with an upper limit and make sure that eBPF connection tracking only is disabled on kernels within the range having the bug. xref: https://github.com/weaveworks/scope/issues/3131 --- probe/endpoint/ebpf.go | 3 +-- probe/endpoint/ebpf_test.go | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/probe/endpoint/ebpf.go b/probe/endpoint/ebpf.go index ac50fdb94..19888e1d7 100644 --- a/probe/endpoint/ebpf.go +++ b/probe/endpoint/ebpf.go @@ -106,8 +106,7 @@ func isKernelSupported() error { // not "119-ish", so allow it. return nil } - // TODO: give the check an upper limit once the bug is fixed - if major == 4 && minor == 4 && abiNumber >= 119 { + if major == 4 && minor == 4 && abiNumber >= 119 && abiNumber < 127 { // https://github.com/weaveworks/scope/issues/3131 // https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1763454 return fmt.Errorf("got Ubuntu kernel %s with known bug", release) diff --git a/probe/endpoint/ebpf_test.go b/probe/endpoint/ebpf_test.go index 98c62116b..52baae8d3 100644 --- a/probe/endpoint/ebpf_test.go +++ b/probe/endpoint/ebpf_test.go @@ -273,6 +273,11 @@ func TestIsKernelSupported(t *testing.T) { "#143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018", false, }, + { + "4.4.0-127-generic", + "#153-Ubuntu SMP Sat May 19 10:58:46 UTC 2018", + true, + }, { "4.4.0-116-generic", "#140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018",