From 917c2e787ff5bb43dc747ce79e33d286b5cb2c6f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 16 Apr 2024 10:08:04 +0200 Subject: 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) --- executor/common_linux.h | 7 +++++-- pkg/csource/generated.go | 6 ++++-- 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]; -- cgit mrf-deployment