From 15215d0c2c80527f89863f89cd7007ada1288a2f Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Mon, 10 Jul 2017 15:41:00 +0100 Subject: [PATCH] prevent concurrent map access in ebpf fd install event handler which presumably could cause havoc --- probe/endpoint/ebpf.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/probe/endpoint/ebpf.go b/probe/endpoint/ebpf.go index 7b1708952..f69d48df1 100644 --- a/probe/endpoint/ebpf.go +++ b/probe/endpoint/ebpf.go @@ -180,6 +180,10 @@ func (t *EbpfTracker) handleFdInstall(ev tracer.EventType, pid int, fd int) { if !ok { return } + + t.Lock() + defer t.Unlock() + t.openConnections[tuple] = ebpfConnection{ incoming: true, tuple: tuple,