aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/openbsd/init.go7
-rw-r--r--sys/openbsd/init_test.go5
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go
index c72a80931..e90ffb115 100644
--- a/sys/openbsd/init.go
+++ b/sys/openbsd/init.go
@@ -20,6 +20,7 @@ func InitTarget(target *prog.Target) {
DIOCKILLSTATES: target.GetConst("DIOCKILLSTATES"),
KERN_MAXCLUSTERS: target.GetConst("KERN_MAXCLUSTERS"),
KERN_MAXTHREAD: target.GetConst("KERN_MAXTHREAD"),
+ KERN_WITNESS: target.GetConst("KERN_WITNESS"),
S_IFCHR: target.GetConst("S_IFCHR"),
S_IFMT: target.GetConst("S_IFMT"),
MCL_FUTURE: target.GetConst("MCL_FUTURE"),
@@ -40,6 +41,7 @@ type arch struct {
DIOCKILLSTATES uint64
KERN_MAXCLUSTERS uint64
KERN_MAXTHREAD uint64
+ KERN_WITNESS uint64
S_IFCHR uint64
S_IFMT uint64
MCL_FUTURE uint64
@@ -247,6 +249,11 @@ func (arch *arch) neutralizeSysctlKern(mib []*prog.ConstArg) bool {
return true
}
+ if len(mib) >= 2 &&
+ mib[0].Val == arch.CTL_KERN && mib[1].Val == arch.KERN_WITNESS {
+ return true
+ }
+
return false
}
diff --git a/sys/openbsd/init_test.go b/sys/openbsd/init_test.go
index 3a6c2c14c..2a9ed640c 100644
--- a/sys/openbsd/init_test.go
+++ b/sys/openbsd/init_test.go
@@ -94,6 +94,11 @@ func TestNeutralize(t *testing.T) {
Out: `sysctl$kern(&(0x7f0000000300)={0x0}, 0x0, 0x0, 0x0, &(0x7f0000000300)="ff0380c5", 0x4)`,
},
{
+ // Test for sysctl kern.witness.
+ In: `sysctl$kern(&(0x7f0000000300)={0x1, 0x3c}, 0x2, 0x0, 0x0, &(0x7f0000000300)="ff0380c5", 0x4)`,
+ Out: `sysctl$kern(&(0x7f0000000300)={0x0}, 0x0, 0x0, 0x0, &(0x7f0000000300)="ff0380c5", 0x4)`,
+ },
+ {
In: `clock_settime(0x0, &(0x7f0000cc0ff0)={0x0, 0x0})`,
Out: `clock_settime(0xffffffffffffffff, &(0x7f0000cc0ff0))`,
},