]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 507866 - fanotify_mark dirfd isn't checked
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 31 Aug 2025 06:21:23 +0000 (08:21 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 31 Aug 2025 06:21:23 +0000 (08:21 +0200)
NEWS
coregrind/m_syswrap/syswrap-linux.c

diff --git a/NEWS b/NEWS
index b1f4d8d11a335a10cd3830101d8ef978de82da61..d9ac8bdcb87eeefdce42e5ef41c1fb5ef782d84a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -76,6 +76,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 507720  Review syscalls returning file descriptors (other platforms)
 507721  Wire up illumos and Solaris mallinfo
 507853  faccessat and faccessat2 should handle AT_FDCWD and absolute paths
+507866  fanotify_mark dirfd isn't checked
 507868  futimesat doesn't handle AT_FDCWD
 507869  Various at syscalls don't check dirfd argument
 507873  Make fchmodat and fchmodat2 syscall wrappers accept AT_FDCWD
index 785031c108221bcffa9e581d8d4c5c0f9bf2c87c..a511ccfe21dd3fc4fbca98e49322f2f455fedcf2 100644 (file)
@@ -2862,11 +2862,12 @@ PRE(sys_fanotify_mark)
                  int, dfd, const char *, pathname);
    if (ARG5)
       PRE_MEM_RASCIIZ( "fanotify_mark(path)", ARG5);
-   if ( !ML_(fd_allowed)(SARG1, "fanotify_mark", tid, False) )
-      SET_STATUS_Failure( VKI_EBADF );
 #else
 #  error Unexpected word size
 #endif
+    if ( !ML_(fd_allowed)(SARG1, "fanotify_mark[fanotify_fd]", tid, False) )
+       SET_STATUS_Failure( VKI_EBADF );
+    ML_(fd_at_check_allowed)(SARG4, (const HChar*)ARG5, "mkdirat[firfd]", tid, status);
 }
 
 /* ---------------------------------------------------------------------