aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-04-16 10:08:04 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-04-16 08:50:03 +0000
commit917c2e787ff5bb43dc747ce79e33d286b5cb2c6f (patch)
treef55c64d4f68864a5ddc13991a336614af7f606d2
parent0d592ce46ebc504d579c07e5bc3f7f3f2038c4cf (diff)
executor: ignore socketpair error in syz_usbip_server_init
Fuzzer managed to do: executing program 4: ... prlimit64(0x0, 0x7, &(0x7f0000000000), 0x0) ... syz_usbip_server_init(0x3) ... SYZFATAL: executor 4 failed 11 times: executor 4: exit status 67 SYZFAIL: syz_usbip_server_init: socketpair failed (errno 24: Too many open files)
-rw-r--r--executor/common_linux.h7
-rw-r--r--pkg/csource/generated.go6
2 files changed, 9 insertions, 4 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index e83bad6c0..f53a0e781 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -2046,8 +2046,11 @@ static long syz_usbip_server_init(volatile long a0)
bool usb3 = (speed == USB_SPEED_SUPER);
int socket_pair[2];
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair))
- fail("syz_usbip_server_init: socketpair failed");
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair)) {
+ // This can happen if the test calls prlimit(RLIMIT_AS).
+ debug("syz_usbip_server_init: socketpair failed (%d)\n", errno);
+ return -1;
+ }
int client_fd = socket_pair[0];
int server_fd = socket_pair[1];
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index 34b0d2c55..6f5cf9095 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -4479,8 +4479,10 @@ static long syz_usbip_server_init(volatile long a0)
bool usb3 = (speed == USB_SPEED_SUPER);
int socket_pair[2];
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair))
- fail("syz_usbip_server_init: socketpair failed");
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair)) {
+ debug("syz_usbip_server_init: socketpair failed (%d)\n", errno);
+ return -1;
+ }
int client_fd = socket_pair[0];
int server_fd = socket_pair[1];