From 6ba5fe3e62880ddf8aeec68ab44eabaa8bc148b8 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 30 Aug 2018 13:02:07 -0700 Subject: sys/openbsd: disable mknod sanitization as tests fail TestSerializeDeserializeRandom fails from time to time because program is different after we serialize/deserialize it. Turns out openbsd SanitizeCall is not idempotent. Add a test for this and disable the logic for now. --- sys/openbsd/init.go | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'sys/openbsd') diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go index ac06ad644..3f4641405 100644 --- a/sys/openbsd/init.go +++ b/sys/openbsd/init.go @@ -26,24 +26,27 @@ func (arch *arch) SanitizeCall(c *prog.Call) { // Prevent vnodes of type VBAD from being created. Such vnodes will // likely trigger assertion errors by the kernel. - pos := 1 - switch c.Meta.CallName { - case "mknodat": - pos = 2 - fallthrough - case "mknod": - mode := c.Args[pos].(*prog.ConstArg) - if (mode.Val & arch.unix.S_IFMT) != arch.unix.S_IFMT { - return - } - saneMode := mode.Val & ^arch.unix.S_IFMT - switch { - case (mode.Val & arch.unix.S_IFCHR) == arch.unix.S_IFCHR: - mode.Val = saneMode | arch.unix.S_IFCHR - case (mode.Val & arch.unix.S_IFBLK) == arch.unix.S_IFBLK: - mode.Val = saneMode | arch.unix.S_IFBLK - case (mode.Val & arch.unix.S_IFIFO) == arch.unix.S_IFIFO: - mode.Val = saneMode | arch.unix.S_IFIFO + // TODO(dvyukov): this is disabled for now because TestSanitizeRandom fails. + if false { + pos := 1 + switch c.Meta.CallName { + case "mknodat": + pos = 2 + fallthrough + case "mknod": + mode := c.Args[pos].(*prog.ConstArg) + if mode.Val&arch.unix.S_IFMT != arch.unix.S_IFMT { + return + } + saneMode := mode.Val & ^arch.unix.S_IFMT + switch { + case mode.Val&arch.unix.S_IFCHR == arch.unix.S_IFCHR: + mode.Val = saneMode | arch.unix.S_IFCHR + case mode.Val&arch.unix.S_IFBLK == arch.unix.S_IFBLK: + mode.Val = saneMode | arch.unix.S_IFBLK + case mode.Val&arch.unix.S_IFIFO == arch.unix.S_IFIFO: + mode.Val = saneMode | arch.unix.S_IFIFO + } } } } -- cgit mrf-deployment