Bug 507867 - perf_event_open group_fd isn't checked
Summary: perf_event_open group_fd isn't checked
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.25 GIT
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Paul Floyd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-04 21:30 UTC by Mark Wielaard
Modified: 2025-08-31 08:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2025-08-04 21:30:29 UTC
int syscall(SYS_perf_event_open, struct perf_event_attr *attr,
                   pid_t pid, int cpu, int group_fd, unsigned long flags);

The PRE handler in coregrind/m_syswrap/syswrap-linux.c doesn't check ARG4.
There are some special cases though:
- group_fd may be -1
- when PERF_FLAG_FD_NO_GROUP is set group_fd is ignored
Comment 1 Paul Floyd 2025-08-31 08:45:38 UTC
commit d9ed6b6f29d217ce9b2c4ccebcc255574d4d55b5 (HEAD -> master, origin/master, origin/HEAD)
Author: Paul Floyd <pjfloyd@wanadoo.fr>
Date:   Sun Aug 31 10:44:49 2025 +0200

    Bug 507867 - perf_event_open group_fd isn't checked