summaryrefslogtreecommitdiffstats
path: root/src/fuzz
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-11 17:57:27 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-11-11 17:57:27 +0100
commit804a6a17597152a56526a6556ce684d644be55e8 (patch)
treefe7ef9f790426cd1168a718a62f5399b58e38398 /src/fuzz
parentfuzz: use SOCK_STREAM instead of SOCK_DGRAM (diff)
downloadsystemd-804a6a17597152a56526a6556ce684d644be55e8.tar.xz
systemd-804a6a17597152a56526a6556ce684d644be55e8.zip
fuzz: set SOCK_CLOEXEC and SOCK_NONBLOCK
Diffstat (limited to 'src/fuzz')
-rw-r--r--src/fuzz/fuzz-dhcp6-client.c2
-rw-r--r--src/fuzz/fuzz-lldp.c2
-rw-r--r--src/fuzz/fuzz-ndisc-rs.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/fuzz/fuzz-dhcp6-client.c b/src/fuzz/fuzz-dhcp6-client.c
index 32a3c30643..0417062c5f 100644
--- a/src/fuzz/fuzz-dhcp6-client.c
+++ b/src/fuzz/fuzz-dhcp6-client.c
@@ -18,7 +18,7 @@ int dhcp6_network_send_udp_socket(int s, struct in6_addr *server_address,
}
int dhcp6_network_bind_udp_socket(int index, struct in6_addr *local_address) {
- assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, test_dhcp_fd) >= 0);
+ assert_se(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_dhcp_fd) >= 0);
return test_dhcp_fd[0];
}
diff --git a/src/fuzz/fuzz-lldp.c b/src/fuzz/fuzz-lldp.c
index db79371797..b9291d4783 100644
--- a/src/fuzz/fuzz-lldp.c
+++ b/src/fuzz/fuzz-lldp.c
@@ -13,7 +13,7 @@
static int test_fd[2] = { -1, -1 };
int lldp_network_bind_raw_socket(int ifindex) {
- if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0, test_fd) < 0)
+ if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) < 0)
return -errno;
return test_fd[0];
diff --git a/src/fuzz/fuzz-ndisc-rs.c b/src/fuzz/fuzz-ndisc-rs.c
index 8a692149e6..9c017acdeb 100644
--- a/src/fuzz/fuzz-ndisc-rs.c
+++ b/src/fuzz/fuzz-ndisc-rs.c
@@ -13,7 +13,7 @@
static int test_fd[2];
int icmp6_bind_router_solicitation(int index) {
- assert_se(socketpair(AF_UNIX, SOCK_STREAM, 0, test_fd) >= 0);
+ assert_se(socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) >= 0);
return test_fd[0];
}