From 794a1ad73ab695b3d3ef099446fa60bc060dd74e Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Wed, 12 Jun 2019 01:50:15 +0200 Subject: sys/openbsd: sanitize setrlimit(RLIMIT_DATA) syscalls (#1231) OpenBSD performs a strict validation of the RLIMIT_DATA soft limit during memory allocation. Lowering the same limit could cause syz-executor to run out of memory quickly. Therefore make sure to not go lower than the default soft limit for the staff group. This is one of the root causes of the high amount of reported "lost connection to test machine". --- sys/openbsd/init_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/openbsd/init_test.go') diff --git a/sys/openbsd/init_test.go b/sys/openbsd/init_test.go index bbd93d6a7..157b46a86 100644 --- a/sys/openbsd/init_test.go +++ b/sys/openbsd/init_test.go @@ -46,6 +46,16 @@ func TestSanitizeMknodCall(t *testing.T) { `mknod(0x0, 0x0, 0x0402)`, `mknod(0x0, 0x0, 0x202)`, }, + { + // RLIMIT_DATA + `setrlimit(0x2, &(0x7f0000cc0ff0)={0x0, 0x80000000})`, + `setrlimit(0x2, &(0x7f0000cc0ff0)={0x60000000, 0x80000000})`, + }, + { + // RLIMIT_CPU + `setrlimit(0x0, &(0x7f0000cc0ff0)={0x1, 0x1})`, + `setrlimit(0x0, &(0x7f0000cc0ff0)={0x1, 0x1})`, + }, } for i, test := range tests { t.Run(fmt.Sprint(i), func(t *testing.T) { -- cgit mrf-deployment