[v2] powerpc/perf: Fix kernel address leaks via Sampling registers

Michael Ellerman patch-notifications at ellerman.id.au
Thu Mar 29 01:13:26 AEDT 2018

On Wed, 2018-03-21 at 11:40:24 UTC, Madhavan Srinivasan wrote:
> From: Michael Ellerman <mpe at ellerman.id.au>
> Current code in power_pmu_disable() does not clear the sampling
> registers like Sampling Instruction Address Register (SAIR) and
> Sampling Data Address Register (SDAR) after disabling the PMU.
> Since these are userspace readable and could contain kernel
> address, add code to explicitly clear the content of these registers.
> Patch also adds a "context synchronizing instruction" to enforce
> no further updates to these registers as mandated by PowerISA.
> "If an mtspr instruction is executed that changes the
> value of a Performance Monitor register other than
> SIAR, SDAR, and SIER, the change is not guaranteed
> to have taken effect until after a subsequent context
> synchronizing instruction has been executed (see
> Chapter 11. "Synchronization Requirements for Con-
> text Alterations" on page 1133)."
> Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>

Applied to powerpc next, thanks.



More information about the Linuxppc-dev mailing list