powerpc/perf: Prevent kernel address leak to userspace via BHRB buffer
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Wed, 21 Mar 2018 11:40:25 +0000 (17:10 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 27 Mar 2018 08:25:09 +0000 (19:25 +1100)
commitbb19af816025d495376bd76bf6fbcf4244f9a06d
tree496051e83f8f73d901909fe68e3699455629ecd4
parente1ebd0e5b9d0a10ba65e63a3514b6da8c6a5a819
powerpc/perf: Prevent kernel address leak to userspace via BHRB buffer

The current Branch History Rolling Buffer (BHRB) code does not check
for any privilege levels before updating the data from BHRB. This
could leak kernel addresses to userspace even when profiling only with
userspace privileges. Add proper checks to prevent it.

Acked-by: Balbir Singh <bsingharora@gmail.com>
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