aboutsummaryrefslogtreecommitdiffstats
path: root/sys/openbsd/init.go
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@basename.se>2020-06-29 20:53:07 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-06-29 21:36:27 +0200
commitcc1e9bc12dd23755159935e93858fcfee121d94e (patch)
tree86c5bf60053759188e212ed04e39f101395db8a2 /sys/openbsd/init.go
parentce9ef6f2ec1adbf0f9938934a6164507b969aea8 (diff)
sys/openbsd: neutralize yet another pf ioctl command
Disarms the latest reproducer[1] for the discovered "no output from test machine" panic. While here, tidy up and improve comments. [1] https://syzkaller.appspot.com/bug?id=4c3b1ac22d6d7f1d9ebcad5469a28cb4562debda
Diffstat (limited to 'sys/openbsd/init.go')
-rw-r--r--sys/openbsd/init.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go
index 6948139aa..f24f06273 100644
--- a/sys/openbsd/init.go
+++ b/sys/openbsd/init.go
@@ -15,6 +15,7 @@ func InitTarget(target *prog.Target) {
arch := &arch{
unix: targets.MakeUnixNeutralizer(target),
DIOCKILLSTATES: target.GetConst("DIOCKILLSTATES"),
+ DIOCCLRSTATES: target.GetConst("DIOCCLRSTATES"),
S_IFMT: target.GetConst("S_IFMT"),
S_IFCHR: target.GetConst("S_IFCHR"),
}
@@ -26,6 +27,7 @@ func InitTarget(target *prog.Target) {
type arch struct {
unix *targets.UnixNeutralizer
+ DIOCCLRSTATES uint64
DIOCKILLSTATES uint64
S_IFMT uint64
S_IFCHR uint64
@@ -94,11 +96,11 @@ func (arch *arch) neutralize(c *prog.Call) {
flags.Val &= ^f
}
case "ioctl":
- // Performing the following ioctl on a /dev/pf file descriptor
- // causes the ssh VM connection to die. For now, just rewire it
- // to an invalid command.
+ // Performing the following ioctl commands on a /dev/pf file
+ // descriptor causes the ssh VM connection to die. For now, just
+ // rewire them to an invalid command.
request := c.Args[1].(*prog.ConstArg)
- if request.Val == arch.DIOCKILLSTATES {
+ if request.Val == arch.DIOCCLRSTATES || request.Val == arch.DIOCKILLSTATES {
request.Val = 0
}
case "mknodat":