diff options
| author | Corey Minyard <cminyard@mvista.com> | 2017-11-02 11:19:15 -0500 |
|---|---|---|
| committer | Corey Minyard <cminyard@mvista.com> | 2017-11-02 11:19:15 -0500 |
| commit | 6297fabd93f93182245383ba7de56bef829a796b (patch) | |
| tree | 804f5d28ada61b402d56281c9a047308d26347f4 /arch/powerpc/kernel/signal_64.c | |
| parent | d7e17fe4f7a7d961cc4375c7d868bd353a039bc7 (diff) | |
| parent | ece1996a21eeb344b49200e627c6660111009c10 (diff) | |
| download | linux-6297fabd93f93182245383ba7de56bef829a796b.tar.gz linux-6297fabd93f93182245383ba7de56bef829a796b.tar.bz2 linux-6297fabd93f93182245383ba7de56bef829a796b.zip | |
Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux into for-next
The IPMI SI driver was split into different pieces, merge the module
tree to accountfor that.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'arch/powerpc/kernel/signal_64.c')
| -rw-r--r-- | arch/powerpc/kernel/signal_64.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index c83c115858c1..b2c002993d78 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c @@ -452,9 +452,20 @@ static long restore_tm_sigcontexts(struct task_struct *tsk, if (MSR_TM_RESV(msr)) return -EINVAL; - /* pull in MSR TM from user context */ + /* pull in MSR TS bits from user context */ regs->msr = (regs->msr & ~MSR_TS_MASK) | (msr & MSR_TS_MASK); + /* + * Ensure that TM is enabled in regs->msr before we leave the signal + * handler. It could be the case that (a) user disabled the TM bit + * through the manipulation of the MSR bits in uc_mcontext or (b) the + * TM bit was disabled because a sufficient number of context switches + * happened whilst in the signal handler and load_tm overflowed, + * disabling the TM bit. In either case we can end up with an illegal + * TM state leading to a TM Bad Thing when we return to userspace. + */ + regs->msr |= MSR_TM; + /* pull in MSR LE from user context */ regs->msr = (regs->msr & ~MSR_LE) | (msr & MSR_LE); |
