]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/perf: Prevent kernel address leak via perf_get_data_addr()
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Wed, 21 Mar 2018 11:40:26 +0000 (17:10 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 27 Mar 2018 08:25:09 +0000 (19:25 +1100)
commit6ad3a941cfd2559f9e7c443130087944483a4980
treeb69f07fd0c77915b86ac3e641b4611a1a546c6e5
parentf477c06d4be85b896d7dd6c0d38737a1bf8c18ab
powerpc/perf: Prevent kernel address leak via perf_get_data_addr()

Sampled Data Address Register (SDAR) is a 64-bit register that
contains the effective address of the storage operand of an
instruction that was being executed, possibly out-of-order, at or
around the time that the Performance Monitor alert occurred.

In certain scenario SDAR happen to contain the kernel address even for
userspace only sampling. Add checks to prevent it.

Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/perf/core-book3s.c