All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dapeng Mi" <dapeng1.mi@linux.intel.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/2] perf/core: Avoid NULL dereference in mux interval store
Date: Mon, 02 Nov 2026 01:22:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-192803@kernel.org> (raw)
In-Reply-To: <20261102005905.2017784-1-dapeng1.mi@linux.intel.com>

> perf_pmu_register() currently exposes the PMU device and its attributes
> before the per-CPU perf_cpu_pmu_context (cpc) has been allocated and
> initialized. That allows a race where user space writes
> perf_event_mux_interval_ms before cpc is ready, and
> perf_event_mux_interval_ms_store() dereferences it unconditionally.
> 
> Fix this by allocating and initializing the per-CPU PMU context before
> making the PMU attribute visible, and add a NULL check in
> perf_event_mux_interval_ms_store() to avoid dereferencing a missing cpc.
> 
> Reported-by: Hanxiang Xu <xuhx@hust.edu.cn>
> Closes: https://lore.kernel.org/all/de936c3.1476b.1a162c34cec.Coremail.xuhx@hust.edu.cn/
> Fixes: 62b856397927 ("perf: Add sysfs entry to adjust multiplexing interval per PMU")
> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102005905.2017784-1-dapeng1.mi@linux.intel.com?part=1


      parent reply	other threads:[~2026-11-02  1:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  0:59 [PATCH 1/2] perf/core: Avoid NULL dereference in mux interval store Dapeng Mi
2026-11-02  0:59 ` [PATCH 2/2] perf/core: Cancel PMU mux hrtimer before freeing per-CPU context Dapeng Mi
2026-11-02  1:14   ` sashiko-bot
2026-11-02  1:22 ` 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-192803@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.