From: Paul Floyd Date: Tue, 11 Mar 2025 19:36:30 +0000 (+0100) Subject: Illumos fdleak: dup2 spurious errors X-Git-Tag: VALGRIND_3_25_0~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd169be0e65fecd1e4b7593dc3da7b87dc7ecf03;p=thirdparty%2Fvalgrind.git Illumos fdleak: dup2 spurious errors We should also put back checks that calls like dup2 aren't using reserved file descriptors. --- diff --git a/coregrind/m_syswrap/syswrap-solaris.c b/coregrind/m_syswrap/syswrap-solaris.c index 3da0d216c..dc0068d90 100644 --- a/coregrind/m_syswrap/syswrap-solaris.c +++ b/coregrind/m_syswrap/syswrap-solaris.c @@ -3989,11 +3989,13 @@ PRE(sys_fcntl) PRE_REG_READ3(long, "fcntl", int, fildes, int, cmd, int, arg); /* Check if a client program isn't going to poison any of V's output fds. */ + /* if (ARG2 == VKI_F_DUP2FD && !ML_(fd_allowed)(ARG3, "fcntl(F_DUP2FD)", tid, False)) { SET_STATUS_Failure(VKI_EBADF); return; } + */ break; /* These ones use ARG3 as "native lock" (input only). */