diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-04-16 18:33:47 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-04-19 10:26:57 +0200 |
| commit | cc8708904da08f9c884253477fc003cc6f6d5945 (patch) | |
| tree | 2a55f301c912629c205ded081351db57c2dde5aa /pkg/csource/csource.go | |
| parent | 90d17ab8980674c6a59f47a062adccb37f99b88a (diff) | |
sys/linux: add timeout call attributes
Move additional call/prog timeouts to descriptions.
Due to this logic duplication executor used 50ms
for syz_mount_image, while pkg/csource used 100ms.
Diffstat (limited to 'pkg/csource/csource.go')
| -rw-r--r-- | pkg/csource/csource.go | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index b198b826e..84f458472 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -73,20 +73,9 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { replacements["SANDBOX_FUNC"] = replacements["SYSCALLS"] replacements["SYSCALLS"] = "unused" } - // Must match timeouts in executor/executor.cc. - specialCallTimeouts := map[string]int{ - "syz_usb_connect": 3000, - "syz_usb_connect_ath9k": 3000, - "syz_usb_control_io": 300, - "syz_usb_ep_write": 300, - "syz_usb_ep_read": 300, - "syz_usb_disconnect": 300, - "syz_open_dev$hiddev": 50, - "syz_mount_image": 100, - } timeoutExpr := "45" for i, call := range p.Calls { - if timeout, ok := specialCallTimeouts[call.Meta.CallName]; ok { + if timeout := call.Meta.Attrs.Timeout; timeout != 0 { timeoutExpr += fmt.Sprintf(" + (call == %d ? %d : 0)", i, timeout) } } |
