From dd169be0e65fecd1e4b7593dc3da7b87dc7ecf03 Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Tue, 11 Mar 2025 20:36:30 +0100 Subject: [PATCH] Illumos fdleak: dup2 spurious errors We should also put back checks that calls like dup2 aren't using reserved file descriptors. --- coregrind/m_syswrap/syswrap-solaris.c | 2 ++ 1 file changed, 2 insertions(+) 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). */ -- 2.47.2