All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "TAKANO Mitsuhiro" <takano32@gmail.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] libperf: Handle an evsel without an fd array in enable/disable
Date: Wed, 11 Nov 2026 10:28:05 +0000	[thread overview]
Message-ID: <sashiko-outbox-208809@kernel.org> (raw)
In-Reply-To: <20261111101625.2204836-1-takano32@gmail.com>

> 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:
> 
>   $ perf stat -a -e '{user_time,cycles}' -- sleep 0.05
>   Segmentation fault
> 
> [ ... ]
> Fixes: 0b18bced5444 ("perf tool_pmu: Make tool PMU events respect enable/disable")
> Link: https://lore.kernel.org/avQIOtt7Y67oXQem@z2
> Suggested-by: Namhyung Kim <namhyung@kernel.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: TAKANO Mitsuhiro <takano32@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111101625.2204836-1-takano32@gmail.com?part=1


      reply	other threads:[~2026-11-11 10:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  8:56 [PATCH] perf evsel: Skip group members without fds when walking a group TAKANO Mitsuhiro
2026-10-23  9:20 ` sashiko-bot
2026-10-23 16:24   ` TAKANO Mitsuhiro
2026-11-10  3:08     ` Hang Zhengyang
2026-11-11  2:33       ` TAKANO Mitsuhiro
2026-11-11  3:48         ` Hang Zhengyang
2026-11-11  6:16 ` Namhyung Kim
2026-11-11 10:16 ` [PATCH v2] libperf: Handle an evsel without an fd array in enable/disable TAKANO Mitsuhiro
2026-11-11 10:28   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-208809@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=takano32@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.