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

Add extra checks for SiGSEV on PR_void system calls #19

Conversation

danielhodder
Copy link

When extensions handle system calls they set the system call ID to 0
(PR_void). This is the same as what happens if a system call isn't
understood by proot. On Android unknown system calls result in a SECCOMP
failure (sending SIGSYS), rather than returning ENOSYS.

This changes the behavour of SIGSYS handing to check if the call was
handled by an extension. If the call was handled by an extention the
call should return 0, since it has been handled outside that context. If
it wasn't handled then we should return ENOSYS. This is because either
that system call doesn't exist, or we aren't allowed to call it. Either
way, since the point of proot is to adapt seccomp to other applications,
we should return ENOSYS because as far as the system is concerned that
system call doesn't exist.

Major props to nhinds for writing a bunch of go programs to help narrow
this down to the the SECCOMP filter and the handing of the SISSYS
signal.

This fixes headmelted/codebuilds#97 and CypherpunkArmory/UserLAnd#938

When extensions handle system calls they set the system call ID to 0
(PR_void). This is the same as what happens if a system call isn't
understood by proot. On Android unknown system calls result in a SECCOMP
failure (sending SIGSYS), rather than returning ENOSYS.

This changes the behavour of SIGSYS handing to check if the call was
handled by an extension. If the call was handled by an extention the
call should return 0, since it has been handled outside that context. If
it wasn't handled then we should return ENOSYS. This is because either
that system call doesn't exist, or we aren't allowed to call it. Either
way, since the point of proot is to adapt seccomp to other applications,
we should return ENOSYS because as far as the system is concerned that
system call doesn't exist.

Major props to nhinds for writing a bunch of go programs to help narrow
this down to the the SECCOMP filter and the handing of the SISSYS
signal.

This fixes headmelted/codebuilds#97 and CypherpunkArmory/UserLAnd#938
Copy link
Member

@corbinlc corbinlc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I am sorry for the very slow response. I am work on this in my spare time again.

@corbinlc corbinlc merged commit 476409e into CypherpunkArmory:master Apr 27, 2020
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.

Missing module error on UserLand (Android)
2 participants