]> www.infradead.org Git - users/dwmw2/linux.git/commit
perf/x86: Check data address for IBS software filter
authorNamhyung Kim <namhyung@kernel.org>
Mon, 17 Mar 2025 16:37:55 +0000 (09:37 -0700)
committerIngo Molnar <mingo@kernel.org>
Mon, 17 Mar 2025 22:37:31 +0000 (23:37 +0100)
commit65a99264f5e5a2bcc8c905f7b2d633e8991672ac
treecd1c55aab643bbdfd2aecd405f793d8f4f503e1f
parent4701f33a10702d5fc577c32434eb62adde0a1ae1
perf/x86: Check data address for IBS software filter

The IBS software filter is filtering kernel samples for regular users in
the PMI handler.  It checks the instruction address in the IBS register to
determine if it was in kernel mode or not.

But it turns out that it's possible to report a kernel data address even
if the instruction address belongs to user-space.  Matteo Rizzo
found that when an instruction raises an exception, IBS can report some
kernel data addresses like IDT while holding the faulting instruction's
RIP.  To prevent an information leak, it should double check if the data
address in PERF_SAMPLE_DATA is in the kernel space as well.

[ mingo: Clarified the changelog ]

Suggested-by: Matteo Rizzo <matteorizzo@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250317163755.1842589-1-namhyung@kernel.org
arch/x86/events/amd/ibs.c