From 38d853dbd3fce7205163af4a67a70cc376a18dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Momar=20TOUR=C3=89?= Date: Thu, 19 Dec 2024 13:12:01 +0100 Subject: [PATCH] done --- pkg/security/resolvers/process/resolver_ebpf.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/security/resolvers/process/resolver_ebpf.go b/pkg/security/resolvers/process/resolver_ebpf.go index 074fab6b649d7..dc704155b475e 100644 --- a/pkg/security/resolvers/process/resolver_ebpf.go +++ b/pkg/security/resolvers/process/resolver_ebpf.go @@ -309,6 +309,9 @@ func (p *EBPFResolver) AddForkEntry(event *model.Event, newEntryCb func(*model.P // AddExecEntry adds an entry to the local cache and returns the newly created entry func (p *EBPFResolver) AddExecEntry(event *model.Event) error { + p.Lock() + defer p.Unlock() + var err error if err := p.ResolveNewProcessCacheEntry(event.ProcessCacheEntry, event.ContainerContext); err != nil { var errResolution *spath.ErrPathResolution @@ -319,9 +322,6 @@ func (p *EBPFResolver) AddExecEntry(event *model.Event) error { if event.ProcessCacheEntry.Pid == 0 { return errors.New("no pid context") } - - p.Lock() - defer p.Unlock() p.insertExecEntry(event.ProcessCacheEntry, event.PIDContext.ExecInode, model.ProcessCacheEntryFromEvent) }