diff options
| author | Peter Zijlstra <[email protected]> | 2025-06-05 10:31:45 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2025-06-05 12:37:51 +0000 |
| commit | 4f6fc782128355931527cefe3eb45338abd8ab39 (patch) | |
| tree | 26dc5fffde5db0a533a9ee7ef206016c3582cf0a /lib/crypto/mpi/mpi-mul.c | |
| parent | perf/x86/intel: Fix incorrect MSR index calculations in intel_pmu_config_acr() (diff) | |
| download | kernel-4f6fc782128355931527cefe3eb45338abd8ab39.tar.gz kernel-4f6fc782128355931527cefe3eb45338abd8ab39.zip | |
perf: Fix sample vs do_exit()
Baisheng Gao reported an ARM64 crash, which Mark decoded as being a
synchronous external abort -- most likely due to trying to access
MMIO in bad ways.
The crash further shows perf trying to do a user stack sample while in
exit_mmap()'s tlb_finish_mmu() -- i.e. while tearing down the address
space it is trying to access.
It turns out that we stop perf after we tear down the userspace mm; a
receipie for disaster, since perf likes to access userspace for
various reasons.
Flip this order by moving up where we stop perf in do_exit().
Additionally, harden PERF_SAMPLE_CALLCHAIN and PERF_SAMPLE_STACK_USER
to abort when the current task does not have an mm (exit_mm() makes
sure to set current->mm = NULL; before commencing with the actual
teardown). Such that CPU wide events don't trip on this same problem.
Fixes: c5ebcedb566e ("perf: Add ability to attach user stack dump to sample")
Reported-by: Baisheng Gao <[email protected]>
Suggested-by: Mark Rutland <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'lib/crypto/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions
