aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_linux.h
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-02-24 18:29:38 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-02-25 18:57:20 +0100
commit5b413887959fc84a48dfef1f619a31ae4f718a5e (patch)
tree78c4dffa095cf22799ca4b749ffed72eeaa7cb8f /executor/common_linux.h
parent7c33726645532432752ae4074ccaad36638db7b1 (diff)
executor: tolerate syz_genetlink_get_family_id failures
We cannot expect syscalls to always succeed during fuzzing, especially when the situation involves a complex interaction with the system. For the syz_genetlink_get_family_id case, it leads to numerous SYZFAIL crashes every day. Don't print a SYZFAIL error for this pseudo syscall.
Diffstat (limited to 'executor/common_linux.h')
-rw-r--r--executor/common_linux.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index 88c129f85..a506ab335 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -2678,11 +2678,8 @@ static long syz_emit_vhci(volatile long a0, volatile long a1)
static long syz_genetlink_get_family_id(volatile long name, volatile long sock_arg)
{
debug("syz_genetlink_get_family_id(%s, %d)\n", (char*)name, (int)sock_arg);
- // We can't trust the socket passed by the fuzzer, it may be not a netlink at all.
- bool dofail = false;
int fd = sock_arg;
if (fd < 0) {
- dofail = true;
fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
if (fd == -1) {
debug("syz_genetlink_get_family_id: socket failed: %d\n", errno);
@@ -2690,7 +2687,7 @@ static long syz_genetlink_get_family_id(volatile long name, volatile long sock_a
}
}
struct nlmsg nlmsg_tmp;
- int ret = netlink_query_family_id(&nlmsg_tmp, fd, (char*)name, dofail);
+ int ret = netlink_query_family_id(&nlmsg_tmp, fd, (char*)name, false);
if ((int)sock_arg < 0)
close(fd);
if (ret < 0) {