diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-07-15 16:43:33 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-07-17 08:31:25 +0000 |
| commit | abd11cfd08430ec5f9d2c6dbd0e0f798816922d1 (patch) | |
| tree | 522a8cc072d07d85c8a1d37b5b3ab89483599b48 /sys/openbsd | |
| parent | a81f309b57265e5760b926274e1f1681e7550e41 (diff) | |
all: apply linter auto fixes
./tools/syz-env bin/golangci-lint run ./... --fix
Diffstat (limited to 'sys/openbsd')
| -rw-r--r-- | sys/openbsd/init.go | 7 |
1 files changed, 4 insertions, 3 deletions
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 } |
