]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/tm: Block signal return setting invalid MSR state
authorMichael Neuling <mikey@neuling.org>
Thu, 19 Nov 2015 04:44:44 +0000 (15:44 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 23 Nov 2015 09:06:31 +0000 (20:06 +1100)
commit1620c4195d94099b1fef3420cb32c50f3b3e4dd6
tree204175f5f1983ff920187640fc5263115400083e
parentdb40e31ebbf3ef7dc8769277dd7bd9cc45daf866
powerpc/tm: Block signal return setting invalid MSR state

Currently we allow both the MSR T and S bits to be set by userspace on
a signal return.  Unfortunately this is a reserved configuration and
will cause a TM Bad Thing exception if attempted (via rfid).

This patch checks for this case in both the 32 and 64 bit signals
code.  If both T and S are set, we mark the context as invalid.

Found using a syscall fuzzer.

Fixes: c1517a9908e8 ("powerpc: Add new transactional memory state to the signal context")
Cc: stable@vger.kernel.org # v3.9+
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/reg.h
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c