diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2017-09-11 12:24:22 +0300 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-09-28 08:29:39 +0300 |
commit | d6e646ad7cfa7034d280459b2b2546288f247144 (patch) | |
tree | 4f3df00bddd8c73734eb6612c6437df881f587d6 /arch/s390/include/asm/runtime_instr.h | |
parent | 8076428f0c9f24d90270204fd39ccb11b83db71d (diff) | |
download | linux-d6e646ad7cfa7034d280459b2b2546288f247144.tar.xz |
s390/runtime instrumention: fix possible memory corruption
For PREEMPT enabled kernels the runtime instrumentation (RI) code
contains a possible use-after-free bug. If a task that makes use of RI
exits, it will execute do_exit() while still enabled for preemption.
That function will call exit_thread_runtime_instr() via
exit_thread(). If exit_thread_runtime_instr() gets preempted after the
RI control block of the task has been freed but before the pointer to
it is set to NULL, then save_ri_cb(), called from switch_to(), will
write to already freed memory.
Avoid this and simply disable preemption while freeing the control
block and setting the pointer to NULL.
Fixes: e4b8b3f33fca ("s390: add support for runtime instrumentation")
Cc: <stable@vger.kernel.org> # v3.7+
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/runtime_instr.h')
0 files changed, 0 insertions, 0 deletions