From 6901a56e001db2bd9705f69cc3f5649134b145ea Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Wed, 16 Oct 2019 18:02:31 +0200 Subject: executor/usb: enable endpoints on SET_INTERFACE This commit changes syz_usb_control_io to enable the relevant endpoints for the interface being set via a SET_INTERFACE request. --- executor/common_linux.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'executor/common_linux.h') diff --git a/executor/common_linux.h b/executor/common_linux.h index de9db05ff..5888b65cf 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -799,6 +799,10 @@ static long syz_extract_tcp_res(volatile long a0, volatile long a1, volatile lon } #endif +#if SYZ_EXECUTOR || SYZ_ENABLE_CLOSE_FDS || __NR_syz_usb_connect +#define MAX_FDS 30 +#endif + #if SYZ_EXECUTOR || __NR_syz_usb_connect #include #include @@ -2630,7 +2634,7 @@ static void close_fds() // Also close all USB emulation descriptors to trigger exit from USB // event loop to collect coverage. int fd; - for (fd = 3; fd < 30; fd++) + for (fd = 3; fd < MAX_FDS; fd++) close(fd); } #endif -- cgit mrf-deployment