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.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go
index e90ffb115..8eb9a726a 100644
--- a/sys/openbsd/init.go
+++ b/sys/openbsd/init.go
@@ -19,6 +19,7 @@ func InitTarget(target *prog.Target) {
DIOCCLRSTATES: target.GetConst("DIOCCLRSTATES"),
DIOCKILLSTATES: target.GetConst("DIOCKILLSTATES"),
KERN_MAXCLUSTERS: target.GetConst("KERN_MAXCLUSTERS"),
+ KERN_MAXPROC: target.GetConst("KERN_MAXPROC"),
KERN_MAXTHREAD: target.GetConst("KERN_MAXTHREAD"),
KERN_WITNESS: target.GetConst("KERN_WITNESS"),
S_IFCHR: target.GetConst("S_IFCHR"),
@@ -40,6 +41,7 @@ type arch struct {
DIOCCLRSTATES uint64
DIOCKILLSTATES uint64
KERN_MAXCLUSTERS uint64
+ KERN_MAXPROC uint64
KERN_MAXTHREAD uint64
KERN_WITNESS uint64
S_IFCHR uint64
@@ -242,6 +244,13 @@ func (arch *arch) neutralizeSysctlKern(mib []*prog.ConstArg) bool {
return true
}
+ // Do not fiddle with root only knob kern.maxproc, can cause the
+ // syz-execprog to run out of resources.
+ if len(mib) >= 2 &&
+ mib[0].Val == arch.CTL_KERN && mib[1].Val == arch.KERN_MAXPROC {
+ return true
+ }
+
// Do not fiddle with root only knob kern.maxthread, can cause the
// syz-execprog process to panic.
if len(mib) >= 2 &&