powerpc/tm: Block signal return setting invalid MSR state
commit5d64942934f0e0b813a0eb4a605551edb12cb416
authorMichael Neuling <mikey@neuling.org>
Thu, 19 Nov 2015 04:44:44 +0000 (19 15:44 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jan 2016 05:49:35 +0000 (28 21:49 -0800)
treea674534965ec6775363f2cf2c04004e31c353d63
parentc496409d87448b18df813332cf40bfecae4e4dc7
powerpc/tm: Block signal return setting invalid MSR state

commit d2b9d2a5ad5ef04ff978c9923d19730cb05efd55 upstream.

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: 2b0a576d15e0 ("powerpc: Add new transactional memory state to the signal context")
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/reg.h
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c