From abd11cfd08430ec5f9d2c6dbd0e0f798816922d1 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Tue, 15 Jul 2025 16:43:33 +0200 Subject: all: apply linter auto fixes ./tools/syz-env bin/golangci-lint run ./... --fix --- sys/openbsd/init.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/openbsd') diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go index 5d0c3a77c..80cb6d4f0 100644 --- a/sys/openbsd/init.go +++ b/sys/openbsd/init.go @@ -170,20 +170,21 @@ func (arch *arch) neutralizeRlimit(c *prog.Call) { rlimitMin := uint64(0) rlimitMax := uint64(math.MaxUint64) resource := c.Args[0].(*prog.ConstArg).Val & rlimitMask - if resource == arch.RLIMIT_DATA { + switch resource { + case arch.RLIMIT_DATA: // 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. rlimitMin = 1536 * 1024 * 1024 - } else if resource == arch.RLIMIT_STACK { + case arch.RLIMIT_STACK: // 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 majority of memory is reserved for the stack. rlimitMax = 1 * 1024 * 1024 - } else { + default: return } -- cgit mrf-deployment