test(runner): verify sandbox isolation with a hostile program suite

This commit is contained in:
shira committed 2026-10-11 08:59:59 +03:00
1 parent afee564bf4
commit e858280d91
38 files changed
+1359 -168

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
// Thread bomb: goroutines blocked in system calls force the runtime to
// create threads; the cgroup process limit must stop it.
package main
import (
"os"
"syscall"
)
func main() {
var fds [2]int
if err := syscall.Pipe(fds[:]); err != nil {
os.Exit(2)
}
for {
go func() {
buffer := make([]byte, 1)
_, _ = syscall.Read(fds[0], buffer)
}()
}
}