diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-01-05 12:44:49 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-01-05 12:50:29 +0100 |
| commit | d646e21ff436cd2a40b23314436cd53f21ae9500 (patch) | |
| tree | c6a58928ecfbef09b335d19a6d8c20884203b688 /sys/linux/init.go | |
| parent | c5f5069930ee90925617ded2e413bc99716eb559 (diff) | |
prog: fix tests for string enforcement
String value enforcement broke a number of tests
where we use different values.
Be more string as to what string values we use in tests.
Required to add tmpfs descriptions to test syz_mount_image.
Also special-casing AF_ALG algorithms as these are auto-generated.
Diffstat (limited to 'sys/linux/init.go')
| -rw-r--r-- | sys/linux/init.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/sys/linux/init.go b/sys/linux/init.go index aea6a6957..cf54ffcd0 100644 --- a/sys/linux/init.go +++ b/sys/linux/init.go @@ -4,7 +4,6 @@ package linux import ( - "bytes" "runtime" "github.com/google/syzkaller/prog" @@ -215,8 +214,6 @@ func (arch *arch) sanitizeCall(c *prog.Call) { default: family.Val = ^uint64(0) } - case "syz_open_procfs": - arch.sanitizeSyzOpenProcfs(c) case "syz_open_dev": enforceIntArg(c.Args[0]) enforceIntArg(c.Args[1]) @@ -279,26 +276,6 @@ func (arch *arch) sanitizeIoctl(c *prog.Call) { } } -func (arch *arch) sanitizeSyzOpenProcfs(c *prog.Call) { - // If fuzzer manages to open /proc/self/exe, it does some nasty things with it: - // - mark as non-executable - // - set some extended acl's that prevent execution - // - mark as immutable, etc - // As the result we fail to start executor again and recreate the VM. - // Don't let it open /proc/self/exe. - ptr := c.Args[1].(*prog.PointerArg) - if ptr.Res != nil { - arg := ptr.Res.(*prog.DataArg) - file := arg.Data() - for len(file) != 0 && (file[0] == '/' || file[0] == '.') { - file = file[1:] - } - if bytes.HasPrefix(file, []byte("exe")) { - arg.SetData([]byte("net\x00")) - } - } -} - func (arch *arch) generateTimespec(g *prog.Gen, typ0 prog.Type, old prog.Arg) (arg prog.Arg, calls []*prog.Call) { typ := typ0.(*prog.StructType) // We need to generate timespec/timeval that are either |
