aboutsummaryrefslogtreecommitdiffstats
path: root/sys/openbsd
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-07-15 16:43:33 +0200
committerTaras Madan <tarasmadan@google.com>2025-07-17 08:31:25 +0000
commitabd11cfd08430ec5f9d2c6dbd0e0f798816922d1 (patch)
tree522a8cc072d07d85c8a1d37b5b3ab89483599b48 /sys/openbsd
parenta81f309b57265e5760b926274e1f1681e7550e41 (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.go7
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
}