summaryrefslogtreecommitdiff
path: root/include/asm-generic/percpu.h
diff options
context:
space:
mode:
authorGustavo Romero <gromero@linux.vnet.ibm.com>2017-08-22 21:20:09 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-12 09:51:23 (GMT)
commit6a988259b1cbbde82d4e2d844b376a81e78c7a32 (patch)
treeeadec3d5182f1455492ec58f59a9b6370a5db8f3 /include/asm-generic/percpu.h
parentafebf5ef60da6d15e75398e41ea2817c7a2bb283 (diff)
downloadlinux-6a988259b1cbbde82d4e2d844b376a81e78c7a32.tar.xz
powerpc/tm: Fix illegal TM state in signal handler
commit 044215d145a7a8a60ffa8fdc859d110a795fa6ea upstream. Currently it's possible that on returning from the signal handler through the restore_tm_sigcontexts() code path (e.g. from a signal caught due to a `trap` instruction executed in the middle of an HTM block, or a deliberately constructed sigframe) an illegal TM state (like TS=10 TM=0, i.e. "T0") is set in SRR1 and when `rfid` sets implicitly the MSR register from SRR1 register on return to userspace it causes a TM Bad Thing exception. That illegal state can be set (a) by a malicious user that disables the TM bit by tweaking the bits in uc_mcontext before returning from the signal handler or (b) by a sufficient number of context switches occurring such that the load_tm counter overflows and TM is disabled whilst in the signal handler. This commit fixes the illegal TM state by ensuring that TM bit is always enabled before we return from restore_tm_sigcontexts(). A small comment correction is made as well. Fixes: 5d176f751ee3 ("powerpc: tm: Enable transactional memory (TM) lazily for userspace") Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com> Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/asm-generic/percpu.h')
0 files changed, 0 insertions, 0 deletions