aboutsummaryrefslogtreecommitdiffstats
path: root/sys/openbsd/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'sys/openbsd/init.go')
-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
}