summaryrefslogtreecommitdiff
path: root/lib/cpu-notifier-error-inject.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2025-03-22 08:13:01 +0100
committerIngo Molnar <mingo@kernel.org>2025-03-22 08:18:24 +0100
commit50a53b60e141d7e31368a87e222e4dd5597bd4ae (patch)
tree983d1679ce2ec928492138a15ba77f6ab6579cce /lib/cpu-notifier-error-inject.c
parent5c7474b5449ccda2f0139e87425845baa2dae15a (diff)
downloadlwn-50a53b60e141d7e31368a87e222e4dd5597bd4ae.tar.gz
lwn-50a53b60e141d7e31368a87e222e4dd5597bd4ae.zip
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: 65a99264f5e5 perf/x86: Check data address for IBS software filter Follow that up with a more complete fix. Fixes: d29e744c7167 ("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
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions