From cc1e9bc12dd23755159935e93858fcfee121d94e Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Mon, 29 Jun 2020 20:53:07 +0200 Subject: 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 --- sys/openbsd/init.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/openbsd/init.go') 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": -- cgit mrf-deployment