aboutsummaryrefslogtreecommitdiffstats
path: root/lib/chaseccomp/buffer.chasc
Commit message (Collapse)AuthorAgeFilesLines
* buffer: drop pipe, pipe2, passFd privilegesbptato2025-01-301-2/+0
| | | | | All uses of these could be delegated to other processes with more privileges.
* buffer: remove server socketbptato2025-01-091-12/+0
| | | | | | | | | | | Now we just pass through a socket created in pager. This removes the need for a socket directory, and strengthens the buffer sandbox slightly. I've kept the ServerSocket code, because I want to add some form of RPC and communication between separate instances in the future. However, I don't expect this to be handled outside the main process, so I've removed the Capsicum-specific connectat/bindat code.
* buffer.chasc: allow reversed clone syscall signaturebptato2024-12-221-2/+6
| | | | | | | This caused buffer cloning to choke on armhf. It seems that cris and S/390 architectures also swap flags and stack; luckily, both are dead.
* chaseccomp: lock down clone; fix mprotect on bionicbptato2024-11-041-2/+19
| | | | | | | | | | | * add restrictions on clone for buffer filter - hardcoded it for musl, glibc and bionic. hopefully they don't change it too soon... * remove define directive from gen_syscalls - now the arch nr check is hardcoded in gen_defs. makes things a bit less complex. * fix borked mprotect filter on bionic - this completely broke the browser.
* chaseccomp: fix compilation with newest dash, misc changesbptato2024-10-311-0/+2
| | | | | | | | | | | | | | * fix matching on unstripped whitespace: caught after upgrading to upstream dash & chaseccomp wouldn't compile * add defines to ensure that we computed the filter length correctly * inline cut_label * EPERM on sigaction, sigprocmask, gettid, and kill on tgkill (so a crash doesn't trigger sandbox violations) * move SIGSYS handler to C and add one for the network The last change removes the stack trace from SIGSYS, but gives us the syscall number which is probably more useful. (Indeed, we don't even have a stack trace in release builds.)
* sandbox: replace libseccomp with chaseccompbptato2024-10-231-0/+39
This drops libseccomp as a dependency. Also, move the capsicum/pledge definitions from bindings to sandbox.nim because they are only used there. Interestingly, after integrating chaseccomp I found that the stbi process would mysteriously crash by a getrandom(2) syscall. Closer investigation revealed it is only called on the initialization of glibc's malloc; presumably it had never surfaced before because libseccomp would always allocate before entering the sandbox. So I've added getrandom to our filter as well.