From: Paul Floyd Date: Fri, 5 Sep 2025 06:11:15 +0000 (+0200) Subject: Solaris syscall: add ML_(fd_allowed) check for fstat X-Git-Tag: VALGRIND_3_26_0~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b06af3d21fe9630a77fd2f9fc2c0e712f5cb78eb;p=thirdparty%2Fvalgrind.git Solaris syscall: add ML_(fd_allowed) check for fstat --- diff --git a/coregrind/m_syswrap/syswrap-solaris.c b/coregrind/m_syswrap/syswrap-solaris.c index a4f243f8a..519d92d39 100644 --- a/coregrind/m_syswrap/syswrap-solaris.c +++ b/coregrind/m_syswrap/syswrap-solaris.c @@ -2344,6 +2344,8 @@ PRE(sys_fstat) PRINT("sys_fstat ( %ld, %#lx )", SARG1, ARG2); PRE_REG_READ2(long, "fstat", int, fildes, struct stat *, buf); PRE_MEM_WRITE("fstat(buf)", ARG2, sizeof(struct vki_stat)); + if (!ML_(fd_allowed)(ARG1, "fstat", tid, False)) + SET_STATUS_Failure(VKI_EBADF); } POST(sys_fstat)