aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_bsd.h
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-12-06 11:30:24 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-12-06 14:28:24 +0100
commita5338d9cd2efcf914ba78edfe2615c7c0657b157 (patch)
treeb05d71e5ceac9986fb2414215fb714091745c79d /executor/common_bsd.h
parentb18e90e04ac0c6a06518fc9469dc7d12d83db901 (diff)
executor: spread overlapping fds
There's a chance that the methods from common_bsd.h and common_linux.h could dup2 (and thus close) an fd belonging to a kcov instance. Prevent this by adjusting fd consts.
Diffstat (limited to 'executor/common_bsd.h')
-rw-r--r--executor/common_bsd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/common_bsd.h b/executor/common_bsd.h
index 332e68e5f..7293df993 100644
--- a/executor/common_bsd.h
+++ b/executor/common_bsd.h
@@ -230,7 +230,7 @@ static void initialize_tun(int tun_id)
}
// Remap tun onto higher fd number to hide it from fuzzer and to keep
// fd numbers stable regardless of whether tun is opened or not (also see kMaxFd).
- const int kTunFd = 240;
+ const int kTunFd = 200;
if (dup2(tunfd, kTunFd) < 0)
fail("dup2(tunfd, kTunFd) failed");
close(tunfd);