From a5338d9cd2efcf914ba78edfe2615c7c0657b157 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 6 Dec 2021 11:30:24 +0000 Subject: 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. --- executor/common_bsd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'executor/common_bsd.h') 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); -- cgit mrf-deployment