-
Notifications
You must be signed in to change notification settings - Fork 584
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
Syscalls py (#3106) #3624
Syscalls py (#3106) #3624
Conversation
* Update syscalls.py * add syscall_groups.c
This pull request introduces 1 alert when merging 45701dd into 0c73dbc - view on LGTM.com new alerts:
|
#!/usr/bin/python3 | ||
|
||
from subprocess import run | ||
from os import system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgotten to remove.
I like that the file can now be automatically be generated. 👍 What I don't like so much, is that it uses systemd-analyze and therefore adds a build-dependency on the systemd package, which makes it more complicated to build on systems/distros not using systemd. |
That's why I added it this way. However, we could add it to git and rebuild if systemd-analyze is available.
By arch? IDK @topimiettinen can say more, but as I get it in #3624 it works. |
By either kernel version or arch. If this list is built on a system with a recent kernel, it will include syscalls that are not supported on older systems (this was protected before with #ifdef, so it was only available when the system being built for supports it). |
Ok, if I understand #3106 correctly, then firejail is ignoring unknown/invalid syscall names. Then please ignore my comment. :-) |
Firejail's src/include/syscall_x86_64.h etc. do not care if the libc defines the syscalls or not, they are always available. If Firejail is running on an old kernel, it's possible to filter newer system calls than the kernel expects but this is OK. Seccomp BPF code just compares register values to constants and so it doesn't matter if these are system call numbers or something else. Also the applications can always call anything they want with syscall(2), regardless of the libc or kernel support.
Another approach would be copying relevant parts of systemd src/shared/seccomp-util.c directly, it's LGPL2.1+. It could be also pre-processed to extract the tables and replace NULs with commas. It wouldn't help with the arch problem though. Yet another approach would be changing over to libseccomp, but it's nice that Firejail does not depend on lots of libraries. Also direct BPF is more powerful. |
I'm not sure if I get you right.
Sounds good, but I haven't found it in libseccomps repo. |
I expected Other sources for system calls could be libseccomp src/syscalls.csv, systemd src/shared/syscall-names.text and various kernel files like arch/arm/tools/syscall.tbl. |
@topimiettinen