Re: [PATCH v2] libperf: Handle an evsel without an fd array in enable/disable
From: Namhyung Kim
Date: Thu Nov 19 2026 - 22:54:11 EST
On Wed, 11 Nov 2026 10:16:24 +0000, TAKANO Mitsuhiro wrote:
> A group led by a tool PMU event is opened with the members' group_fd set
> to the leader's file descriptor. For a tool event that descriptor comes
> from open("/proc/stat"), not from perf_event_open(), so a member the
> kernel refuses is marked unsupported; perf stat then releases the fd
> array of that member while the evsel stays in the group.
>
> Enabling the group goes through evsel__enable_cpu(), which enables the
> members of a mixed PMU group from userspace because the kernel does not
> do it along with the leader. The member has no fd array left, so
> perf_evsel__run_ioctl() reads its loop bound through xyarray__max_y()
> and dereferences a NULL pointer:
>
> [...]
Applied to perf-tools-next, thanks!
Best regards
Namhyung