Skip to content

Conversation

AndersonQ
Copy link
Member

@AndersonQ AndersonQ commented Sep 3, 2025

I'll add the known issue in another PR as it affects other versions

Proposed commit message

libbeat: add 'eventfd2' to default seccomp policy

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

Checklist

  • My code follows the style guidelines of this project
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

  • n/a

How to test this PR locally

follow the steps outlined in the bug on how to reproduce the issue:

Related issues

Use cases

  • anyone using CA reload
  • anyone using any feature causing any beat to re-exec

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 3, 2025
Copy link
Contributor

github-actions bot commented Sep 3, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

mergify bot commented Sep 3, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @AndersonQ? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@AndersonQ AndersonQ force-pushed the 46333-fix-seccomp-default-policy branch from 911674b to d0078f2 Compare September 3, 2025 17:12
@AndersonQ AndersonQ added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team bugfix labels Sep 3, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 3, 2025
@AndersonQ AndersonQ force-pushed the 46333-fix-seccomp-default-policy branch 2 times, most recently from 44abf81 to 1892a43 Compare September 4, 2025 12:45
@belimawr belimawr self-requested a review September 4, 2025 12:49
@AndersonQ AndersonQ force-pushed the 46333-fix-seccomp-default-policy branch from 1892a43 to 45371ed Compare September 4, 2025 14:49
@AndersonQ AndersonQ force-pushed the 46333-fix-seccomp-default-policy branch from 45371ed to 5f31562 Compare September 4, 2025 14:57
Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.
@AndersonQ AndersonQ force-pushed the 46333-fix-seccomp-default-policy branch from 5f31562 to de0ad4a Compare September 4, 2025 14:57
@AndersonQ AndersonQ marked this pull request as ready for review September 4, 2025 14:57
@AndersonQ AndersonQ requested a review from a team as a code owner September 4, 2025 14:57
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@AndersonQ AndersonQ added backport-8.18 Automated backport to the 8.18 branch backport-9.0 Automated backport to the 9.0 branch backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch labels Sep 4, 2025
Copy link
Contributor

mergify bot commented Sep 8, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b 46333-fix-seccomp-default-policy upstream/46333-fix-seccomp-default-policy
git merge upstream/main
git push upstream 46333-fix-seccomp-default-policy

@AndersonQ AndersonQ enabled auto-merge (squash) September 8, 2025 14:02
@AndersonQ AndersonQ merged commit 7162773 into elastic:main Sep 8, 2025
205 of 208 checks passed
mergify bot pushed a commit that referenced this pull request Sep 8, 2025
* libbeat: add 'eventfd2' to default seccomp policy

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go
mergify bot pushed a commit that referenced this pull request Sep 8, 2025
* libbeat: add 'eventfd2' to default seccomp policy

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go
mergify bot pushed a commit that referenced this pull request Sep 8, 2025
* libbeat: add 'eventfd2' to default seccomp policy

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go
mergify bot pushed a commit that referenced this pull request Sep 8, 2025
* libbeat: add 'eventfd2' to default seccomp policy

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go
AndersonQ added a commit that referenced this pull request Sep 9, 2025
* libbeat: add 'eventfd2' to default seccomp policy

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go
AndersonQ added a commit that referenced this pull request Sep 9, 2025
…icy (#46450)

* libbeat: add 'eventfd2' to default seccomp policy (#46372)

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go

* fix merge conflicts

---------

Co-authored-by: Anderson Queiroz <[email protected]>
AndersonQ added a commit that referenced this pull request Sep 9, 2025
…licy (#46448)

* libbeat: add 'eventfd2' to default seccomp policy (#46372)

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go

* fix merge conflicts

---------

Co-authored-by: Anderson Queiroz <[email protected]>
AndersonQ added a commit that referenced this pull request Sep 9, 2025
…licy (#46447)

* libbeat: add 'eventfd2' to default seccomp policy (#46372)

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go

---------

Co-authored-by: Anderson Queiroz <[email protected]>
@khushijain21 khushijain21 mentioned this pull request Sep 10, 2025
6 tasks
AndersonQ added a commit that referenced this pull request Sep 10, 2025
…icy (#46449)

* libbeat: add 'eventfd2' to default seccomp policy (#46372)

Since Go introduced https://go.dev/cl/560615 it uses `eventfd2`, which was not part of our default seccomp policy. Due to the `google.golang.org/protobuf` dependency `eventfd2` during its initialisation, before our seccomp policy be applied, thus it worked.
However once filebeat is reexeced, for example, due to a CA change, the seccomp policy would be in place and prevent `eventfd2` call, crashing filebeat.

This change adds `eventfd2` to the default seccomp policy

This also adjusts Beat.doReexec to use os.Executable isntead of manually building the binary path.

(cherry picked from commit 7162773)

# Conflicts:
#	libbeat/tests/integration/elasticsearch_test.go

* fix merge conflicts

* add line break

* fix linting issue

---------

Co-authored-by: Anderson Queiroz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.18 Automated backport to the 8.18 branch backport-8.19 Automated backport to the 8.19 branch backport-9.0 Automated backport to the 9.0 branch backport-9.1 Automated backport to the 9.1 branch bugfix Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filebeat config option restart_on_cert_change consistently causes crash
3 participants