All of lore.kernel.org
 help / color / mirror / Atom feed
From: JunYoung Lee <ljyoung04@gmail.com>
To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	namhyung@kernel.org
Cc: mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
	james.clark@linaro.org, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org, JunYoung Lee <ljyoung04@gmail.com>
Subject: [PATCH v2 0/2] perf/core: Fix kernel page size leak and espfix hang
Date: Wed,  2 Dec 2026 20:59:00 +0900	[thread overview]
Message-ID: <20261202115902.586760-1-ljyoung04@gmail.com> (raw)

Patch 1 stops exclude_kernel events from getting a kernel IP, which
PERF_SAMPLE_CODE_PAGE_SIZE turned into a KASLR leak. Patch 2 fixes the
endless page table walk on a bad pmd (espfix), which events allowed to
profile the kernel can still hit.

v1: https://lore.kernel.org/all/20261202063433.279947-1-ljyoung04@gmail.com/

Changes in v2:
- Filter the kernel IP in perf_instruction_pointer(), where data->ip is
  set, instead of in perf_get_page_size() (Peter).
- Split the bad pmd fix into its own patch (Peter).
- Shorter changelogs.

On data->addr: I found no way on x86 to get a kernel address into an
exclude_kernel sample. Breakpoint addresses are checked when the event
is created, and user mode faults on kernel addresses don't emit the
page-fault software event. On riscv and powerpc that event seems to be
emitted before the kernel address check, so a kernel data->addr may be
possible there. I haven't tested this. Should it be fixed in those
fault handlers, or with a generic check?

JunYoung Lee (2):
  perf/core: Don't report a kernel IP for exclude_kernel events
  perf/core: Don't loop forever on a bad pmd in perf_get_pgtable_size()

 kernel/events/core.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

base-commit: 693c2e04e3f1d4c59af236e1211b7b8cb165a790
-- 
2.56.1

             reply	other threads:[~2026-12-02 11:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 11:59 JunYoung Lee [this message]
2026-12-02 11:59 ` [PATCH v2 1/2] perf/core: Don't report a kernel IP for exclude_kernel events JunYoung Lee
2026-12-02 12:16   ` sashiko-bot
2026-12-02 11:59 ` [PATCH v2 2/2] perf/core: Don't loop forever on a bad pmd in perf_get_pgtable_size() JunYoung Lee
2026-12-02 12:16 ` [PATCH v2 0/2] perf/core: Fix kernel page size leak and espfix hang sashiko-bot

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=20261202115902.586760-1-ljyoung04@gmail.com \
    --to=ljyoung04@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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.