Skip to content

Commit

Permalink
[auditbeat] Allow memfd_create(2) in seccomp for add_session_metadata…
Browse files Browse the repository at this point in the history
…@ebpf (#41297)

Quark was falling back into kprobe since ebpf would fail with EPERM at
memfd_create(2).

```
$ strace -f auditbeat ....
[pid  2917] memfd_create("libbpf-placeholder-fd", MFD_CLOEXEC) = -1 EPERM (Operation not permitted)
```

With this my test case where kprobe is disabled now uses ebpf when I select
backend "auto", before it was falling back to procfsprovider.
  • Loading branch information
haesbaert authored Oct 18, 2024
1 parent b493c7f commit 6766cfa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x-pack/auditbeat/seccomp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,13 @@ func init() {
); err != nil {
panic(err)
}

// The sessionmd processor kerneltracingprovider needs
// memfd_create to operate via EBPF
if err := seccomp.ModifyDefaultPolicy(seccomp.AddSyscall,
"memfd_create",
); err != nil {
panic(err)
}
}
}

0 comments on commit 6766cfa

Please sign in to comment.