Bug 507866

Summary: fanotify_mark dirfd isn't checked
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: Paul Floyd <pjfloyd>
Status: RESOLVED FIXED    
Severity: normal CC: ahajkova, pjfloyd
Priority: NOR    
Version First Reported In: 3.25 GIT   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Mark Wielaard 2025-08-04 21:16:56 UTC
int fanotify_mark(int fanotify_fd, unsigned int flags,
                         uint64_t mask, int dirfd,
                         const char *_Nullable pathname);

The PRE handler in coregrind/m_syswrap/syswrap-linux.c only check fd, not dirfd.
Note that:
- dirfd may be AT_FDCWD.
- if pathname is absolute, then dirfd is ignored.
Comment 1 Paul Floyd 2025-08-31 06:15:09 UTC
On 32bit platforms fanotify_fd wasn't checked either.
Comment 2 Paul Floyd 2025-08-31 06:22:13 UTC
commit 5f753c39ea6285fec27cc68cbaf6a629c5051f23 (HEAD -> master, origin/master, origin/HEAD)
Author: Paul Floyd <pjfloyd@wanadoo.fr>
Date:   Sun Aug 31 08:21:23 2025 +0200

    Bug 507866 - fanotify_mark dirfd isn't checked