diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-09-28 13:17:51 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-09-29 13:44:19 +0200 |
| commit | 21d737fbf9bad3f2a9190bc31212f29edbfcaeb3 (patch) | |
| tree | 3331ad8c04eac8cf0c13bb9aa448dbdb76693ac6 /sys/targets | |
| parent | d9da3ac6347057f9742c199502651572f46f9bf0 (diff) | |
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.
Diffstat (limited to 'sys/targets')
| -rw-r--r-- | sys/targets/common.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/targets/common.go b/sys/targets/common.go index f55493256..a29365ce3 100644 --- a/sys/targets/common.go +++ b/sys/targets/common.go @@ -82,12 +82,12 @@ func MakeUnixNeutralizer(target *prog.Target) *UnixNeutralizer { } } -func (arch *UnixNeutralizer) Neutralize(c *prog.Call) { +func (arch *UnixNeutralizer) Neutralize(c *prog.Call, fixStructure bool) error { switch c.Meta.CallName { case "mmap": if c.Meta.Name == "mmap$bifrost" { // Mali bifrost mmap doesn't support MAP_FIXED. - return + return nil } // Add MAP_FIXED flag, otherwise it produces non-deterministic results. c.Args[3].(*prog.ConstArg).Val |= arch.MAP_FIXED @@ -98,7 +98,7 @@ func (arch *UnixNeutralizer) Neutralize(c *prog.Call) { } switch c.Args[pos+1].Type().(type) { case *prog.ProcType, *prog.ResourceType: - return + return nil } mode := c.Args[pos].(*prog.ConstArg) dev := c.Args[pos+1].(*prog.ConstArg) @@ -128,4 +128,5 @@ func (arch *UnixNeutralizer) Neutralize(c *prog.Call) { code.Val = 1 } } + return nil } |
