Skip to content

Conversation

@sivukhin
Copy link
Contributor

@sivukhin sivukhin commented Dec 26, 2025

Implement few extra arm-specific syscalls and fix compilation by hiding some methods behind flags

Now it works on my machine:

$> uname -m
aarch64
$> sudo apt install libunwind-dev
$> cargo run -- run --experimental-sandbox 'bash'
Welcome to AgentFS!

The following mount points are sandboxed:
 - /agent -> agent.db (agentfs)

sivukhin@sivukhin:~/turso/agentfs/cli$

- if we will construct syscall from scratch - "unused" args (we have 6 registers in total - but syscall can use less) will be zeroed
- tail_inject will set all registers - potentially overwriting registers unused for this syscall but having some important information for execution
- after this patch I was able to run bash in the sandbox on ARM (with few additional tweaks) - without it shell just behaves "randomly" (it exits immediately, but in some different setups it can work in weird ways - which confirms the explanation of registers overwrite as this will lead to arbitrary UB)
- hide some syscalls behind compile time directives
- implement faccessat and fstatat syscalls
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.

1 participant