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

Native Android Seccomp Limitations #3931

Open
EmmaJaneBonestell opened this issue Mar 7, 2025 · 2 comments
Open

Native Android Seccomp Limitations #3931

EmmaJaneBonestell opened this issue Mar 7, 2025 · 2 comments

Comments

@EmmaJaneBonestell
Copy link

Because rr uses its "own syscalls", rr encounters immediate runtime failures from bad syscalls on native Android devices (e.g., within Termux).

While Android does support seccomp filtering, its security model (since Android OS 8) only allows filtering of valid syscalls. Invalid numbers will cause SIGSYS regardless of seccomp filtering.

It's still possible to setup signal/exception handlers and capture SIGSYS, so I thought about attempting this; however, I'm not familiar enough with rr's codebase, and whether that would break how rr inspects, records, etc., and did not want to waste time implementing something if so.

@rocallahan
Copy link
Collaborator

rr will see SIGSYS being delivered, via a ptrace stop. I think we could detect that it's a SIGSYS on an rr syscall and treat that just as if the rr syscall had executed normally and produced a syscall stop.

@rocallahan
Copy link
Collaborator

In other words we don't actually have to set up any SIGSYS handler. We wouldn't inject the SIGSYS signal and trigger the setting up of a signal stack frame. It should simply be a matter of treating those specific SIGSYSes as a different kind of ptrace stop. We might need to adjust some bits of tracee state to make it look like we entered the kernel.

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

No branches or pull requests

2 participants