From 21d737fbf9bad3f2a9190bc31212f29edbfcaeb3 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 28 Sep 2022 13:17:51 +0000 Subject: sys: control structural changes during neutralization Ideally, we should properly support the already existing fix flag to distinguish between fixing and checking, but for now at least let it control whether structural changes are to be made. Otherwise we get into trouble while hint-mutating syz_mount_image calls, because we iterate over all call arguments and (possibly) remove them at the same time. It leads to `bad group arg size %v, should be <= %v for %#v type %#v` errors. --- sys/openbsd/init.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/openbsd') diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go index 497291244..2a2aeae4c 100644 --- a/sys/openbsd/init.go +++ b/sys/openbsd/init.go @@ -82,7 +82,7 @@ func isExecutorFd(dev uint64) bool { return major == devFdMajor && minor >= 200 } -func (arch *arch) neutralize(c *prog.Call) { +func (arch *arch) neutralize(c *prog.Call, fixStructure bool) error { argStart := 1 switch c.Meta.CallName { case "chflagsat": @@ -150,8 +150,9 @@ func (arch *arch) neutralize(c *prog.Call) { case "sysctl": arch.neutralizeSysctl(c) default: - arch.unix.Neutralize(c) + return arch.unix.Neutralize(c, fixStructure) } + return nil } func (arch *arch) neutralizeClockSettime(c *prog.Call) { -- cgit mrf-deployment