From dad7ee745f0abc782ab120ba0cee9e6c1aec2d9c Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Thu, 13 Jun 2019 17:12:20 +0200 Subject: sys/openbsd: sanitize setrlimit(RLIMIT_STACK) syscalls Do not allow the stack to grow beyond the initial soft limit chosen by syz-executor. Otherwise, syz-executor will most likely not be able to perform any more heap allocations since they majoriy of memory is reserved for the stack. This is one of the root causes of the high amount of reported "lost connection to test machine". --- sys/openbsd/init_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/openbsd/init_test.go') diff --git a/sys/openbsd/init_test.go b/sys/openbsd/init_test.go index 157b46a86..6be30356e 100644 --- a/sys/openbsd/init_test.go +++ b/sys/openbsd/init_test.go @@ -51,6 +51,11 @@ func TestSanitizeMknodCall(t *testing.T) { `setrlimit(0x2, &(0x7f0000cc0ff0)={0x0, 0x80000000})`, `setrlimit(0x2, &(0x7f0000cc0ff0)={0x60000000, 0x80000000})`, }, + { + // RLIMIT_STACK + `setrlimit(0x3, &(0x7f0000cc0ff0)={0x1000000000, 0x1000000000})`, + `setrlimit(0x3, &(0x7f0000cc0ff0)={0x100000, 0x100000})`, + }, { // RLIMIT_CPU `setrlimit(0x0, &(0x7f0000cc0ff0)={0x1, 0x1})`, -- cgit mrf-deployment