From cc8708904da08f9c884253477fc003cc6f6d5945 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 16 Apr 2020 18:33:47 +0200 Subject: 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. --- pkg/csource/csource.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'pkg/csource/csource.go') 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) } } -- cgit mrf-deployment