mirror-linux/arch
Namhyung Kim 50a53b60e1 perf/amd/ibs: Prevent leaking sensitive data to userspace
Although IBS "swfilt" can prevent leaking samples with kernel RIP to the
userspace, there are few subtle cases where a 'data' address and/or a
'branch target' address can fall under kernel address range although RIP
is from userspace. Prevent leaking kernel 'data' addresses by discarding
such samples when {exclude_kernel=1,swfilt=1}.

IBS can now be invoked by unprivileged user with the introduction of
"swfilt". However, this creates a loophole in the interface where an
unprivileged user can get physical address of the userspace virtual
addresses through IBS register raw dump (PERF_SAMPLE_RAW). Prevent this
as well.

This upstream commit fixed the most obvious leak:

  65a99264f5 perf/x86: Check data address for IBS software filter

Follow that up with a more complete fix.

Fixes: d29e744c71 ("perf/x86: Relax privilege filter restriction on AMD IBS")
Suggested-by: Matteo Rizzo <matteorizzo@google.com>
Co-developed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250321161251.1033-1-ravi.bangoria@amd.com
2025-03-22 08:18:24 +01:00
..
alpha alpha: Use str_yes_no() helper in pci_dac_dma_supported() 2025-02-14 14:06:41 -05:00
arc Kbuild updates for v6.14 2025-01-31 12:07:07 -08:00
arm soc: fixes for 6.14, part 2 2025-03-17 14:40:40 -07:00
arm64 soc: fixes for 6.14, part 2 2025-03-17 14:40:40 -07:00
csky asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
hexagon hexagon: Fix unbalanced spinlock in die() 2025-01-30 18:46:06 -08:00
loongarch LoongArch: KVM: Fix GPA size issue about VM 2025-03-08 13:52:04 +08:00
m68k m68k: sun3: add check for __pgd_alloc() 2025-03-05 21:36:12 -08:00
microblaze asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
mips Fix fallout of /scripts/sorttable cleanup 2025-03-02 04:33:15 -08:00
nios2 asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
openrisc The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
parisc mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() 2025-02-27 17:40:57 +00:00
powerpc arm64 fixes for -rc5 2025-03-01 13:44:51 -08:00
riscv soc: fixes for 6.14, part 2 2025-03-17 14:40:40 -07:00
s390 KVM: s390: pv: fix race when making a page secure 2025-03-14 15:24:19 +01:00
sh sh updates for v6.14 2025-02-02 10:40:27 -08:00
sparc mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() 2025-02-27 17:40:57 +00:00
um um: convert irq_lock to raw spinlock 2025-02-12 23:40:59 +01:00
x86 perf/amd/ibs: Prevent leaking sensitive data to userspace 2025-03-22 08:18:24 +01:00
xtensa Xtensa updates for v6.14 2025-01-27 08:16:33 -08:00
.gitignore
Kconfig