aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_usb_netbsd.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-02-21 12:32:11 +0100
committerDmitry Vyukov <dvyukov@google.com>2021-02-21 16:43:26 +0100
commita659b3f1dc889d5ab5ead017b877765b3d042379 (patch)
tree8df03976c96285623e94f39e7a44773170b0a9d8 /executor/common_usb_netbsd.h
parente894953c0c45c8a6d676292a81da90a615133b1c (diff)
pkg/report: detect executor failures
Currently all executor fail errors go into "lost connection" bucket. This is not very useful. First, there are different executor failures. Second, it's not possible to understand what failures happen how frequently. Third, there are not authentic lost connection. Create separate SYZFAIL: bugs for them. Update #573 Update #502 Update #318
Diffstat (limited to 'executor/common_usb_netbsd.h')
-rw-r--r--executor/common_usb_netbsd.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/executor/common_usb_netbsd.h b/executor/common_usb_netbsd.h
index 56c9718be..138b50557 100644
--- a/executor/common_usb_netbsd.h
+++ b/executor/common_usb_netbsd.h
@@ -218,14 +218,11 @@ static volatile long syz_usb_connect_impl(int fd, uint64 speed, uint64 dev_len,
analyze_usb_device(index);
#endif
- int rv = vhci_setport(fd, 1);
- if (rv != 0) {
- fail("syz_usb_connect: vhci_setport failed with %d", errno);
- }
+ if (vhci_setport(fd, 1))
+ fail("syz_usb_connect: vhci_setport failed with");
- rv = vhci_usb_attach(fd);
- if (rv != 0) {
- debug("syz_usb_connect: vhci_usb_attach failed with %d\n", rv);
+ if (vhci_usb_attach(fd)) {
+ debug("syz_usb_connect: vhci_usb_attach failed with %d\n", errno);
return -1;
}
debug("syz_usb_connect: vhci_usb_attach success\n");
@@ -234,8 +231,7 @@ static volatile long syz_usb_connect_impl(int fd, uint64 speed, uint64 dev_len,
while (!done) {
vhci_request_t req;
- rv = vhci_usb_recv(fd, &req, sizeof(req));
- if (rv != 0) {
+ if (vhci_usb_recv(fd, &req, sizeof(req))) {
debug("syz_usb_connect: vhci_usb_recv failed with %d\n", errno);
return -1;
}
@@ -285,6 +281,7 @@ static volatile long syz_usb_connect_impl(int fd, uint64 speed, uint64 dev_len,
else
memset(data, 0, response_length);
+ int rv = 0;
if (req.u.ctrl.bmRequestType & UE_DIR_IN) {
debug("syz_usb_connect: writing %d bytes\n", response_length);
if (response_length > 0) {
@@ -329,9 +326,8 @@ static volatile long syz_usb_connect(volatile long a0, volatile long a1,
debug_dump_data(dev, dev_len);
int fd = vhci_open();
- if (fd < 0) {
- fail("syz_usb_connect: vhci_open failed with %d", errno);
- }
+ if (fd < 0)
+ fail("syz_usb_connect: vhci_open failed");
long res = syz_usb_connect_impl(fd, speed, dev_len, dev, descs, &lookup_connect_response_out_generic);
close(fd);
return res;