]> git.baikalelectronics.ru Git - kernel.git/commit
s390/perf: obtain sie_block from the right address
authorNico Boehr <nrb@linux.ibm.com>
Tue, 24 May 2022 13:43:20 +0000 (15:43 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 25 May 2022 09:46:02 +0000 (11:46 +0200)
commitff41f0281bfacacd1e505c09a2553d44c05712bb
tree9b33bc979aa4ba843702e43862a29ea26f77df15
parent25f86bb4c4bcdd6e345d3c8bf105b47c44b5ae60
s390/perf: obtain sie_block from the right address

Since commit 24925d5eef82 ("s390: fix fpu restore in entry.S"), the
sie_block pointer is located at empty1[1], but in sie_block() it was
taken from empty1[0].

This leads to a random pointer being dereferenced, possibly causing
system crash.

This problem can be observed when running a simple guest with an endless
loop and recording the cpu-clock event:

  sudo perf kvm --guestvmlinux=<guestkernel> --guest top -e cpu-clock

With this fix, the correct guest address is shown.

Fixes: 24925d5eef82 ("s390: fix fpu restore in entry.S")
Cc: stable@vger.kernel.org
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/perf_event.c