Skip to content
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

[hotfix] seccomp: default to -ENOSYS for SECCOMP_RET_ERRNO #2746

Closed
wants to merge 2 commits into from
Closed

[hotfix] seccomp: default to -ENOSYS for SECCOMP_RET_ERRNO #2746

wants to merge 2 commits into from

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Jan 17, 2021

This is a hotfix to make -ENOSYS the default errno if the default action
is SECCOMP_RET_ERRNO. This is necessary because glibc cannot make use of
newer syscalls if we block all unknown syscalls with -EPERM (our old
behaviour).

Unfortunately this is not an ideal solution (syscalls with complicated
rules will now return -ENOSYS rather than -EPERM) but a complete
solution will require far more work -- most likely a reimplementation of
libseccomp to allow us to create custom BPF filters ourselves, or large
changes to libseccomp to better accommodate our requirements -- and thus
this hotfix was written to solve the immediate problem while we work on
a more complete solution.

Fixes #2151
Signed-off-by: Aleksa Sarai [email protected]

This is a hotfix to make -ENOSYS the default errno if the default action
is SECCOMP_RET_ERRNO. This is necessary because glibc cannot make use of
newer syscalls if we block all unknown syscalls with -EPERM (our old
behaviour).

Unfortunately this is not an ideal solution (syscalls with complicated
rules will now return -ENOSYS rather than -EPERM) but a complete
solution will require far more work -- most likely a reimplementation of
libseccomp to allow us to create custom BPF filters ourselves, or large
changes to libseccomp to better accommodate our requirements -- and thus
this hotfix was written to solve the immediate problem while we work on
a more complete solution.

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar
Copy link
Member Author

cyphar commented Jan 18, 2021

@richfelker Maybe this PR (specifically the test program) better demonstrates why we need some way of either having inverse rules or another way of returning -EPERM for intended failures.

@cyphar
Copy link
Member Author

cyphar commented Jan 18, 2021

I've thought of a nicer solution to this problem, which I'll implement in a separate PR tomorrow.

@cyphar cyphar closed this Jan 18, 2021
@cyphar cyphar deleted the seccomp-enosys-hotfix branch January 18, 2021 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

seccomp filter should return ENOSYS for unknown syscalls
1 participant