-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common/seccomp: add rseq syscall #30620
Conversation
@belimawr I am trying to understand the scope of the problem. Which one of the following is true (or both)
Note for future self: https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/ |
@andrewkroh could you take a look at this PR? |
Both are true. I didn't dig too much into the internals of glibc or why/when it's calling My understanding from what was discussed on the Go issue is that by installing this seccomp filters, when I did test some of our official releases, if I remember correctly 7.16.x, they all crash very quickly. I'm happy to dig more into this if needed or to better document which versions that are crashing. Just let me know if it's needed or not. I also tried to get some extra information by running the Linux auditing documented on our |
btw folks (@andrewkroh, @ph), does any of you know if we need to also enable |
I was curious, so I've just tested Filebeat 7.15.0 (downloaded from elastic.co) and it also crashes:
|
rseq syscall is available on glibc >= 2.35, and called when CGO is used. If we don't allow rseq, Beats will eventually crash with an glibc error: `Fatal glibc error: rseq registration failed`. Fixes: elastic#30576
@belimawr Looking at the changes, a user could update their seccomp policy to add rseq fyi @simitt |
6ad6bd4
to
000fdc2
Compare
I also added the |
Awesome! A user already asked for it. I'll try it and report on the issue. Thanks a lot @ph! |
@ph - isn't that exactly the gap I raised between standalone and managed by Elastic Agent? Users can customize for standalone, but not when running under Elastic Agent. |
@simitt This is exactly the game you raised, so we will have to consider it. |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
What does this PR do?
Adds
rseq
to the list of allowed system calls on LinuxWhy is it important?
rseq syscall is available on glibc >= 2.35, and called when CGO is
used. If we don't allow rseq, Beats will eventually crash with an
glibc error:
Fatal glibc error: rseq registration failed
.Checklist
- [ ] 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 worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
rseq
to other architectures.How to test this PR locally
Compile with CGO enabled and run any Beat on a machine (or VM) using glibc >= 2.35. Arch Linux VMs are a good choice for this test. Below is a quick snippet of how to do it using Vagrant
Related issues
Fatal glibc error: rseq registration failed
golang/go#51315## Use cases## ScreenshotsLogs
Here is a
strace -c
of Filebeat after applying this patch,rseq
is the last syscall listed