Revision 96dc89d526ef77604376f06220e3d2931a0bfd58 authored by Michael Neuling on 25 September 2018, 09:36:47 UTC, committed by Michael Ellerman on 25 September 2018, 12:51:32 UTC
Current we store the userspace r1 to PACATMSCRATCH before finally saving it to the thread struct. In theory an exception could be taken here (like a machine check or SLB miss) that could write PACATMSCRATCH and hence corrupt the userspace r1. The SLB fault currently doesn't touch PACATMSCRATCH, but others do. We've never actually seen this happen but it's theoretically possible. Either way, the code is fragile as it is. This patch saves r1 to the kernel stack (which can't fault) before we turn MSR[RI] back on. PACATMSCRATCH is still used but only with MSR[RI] off. We then copy r1 from the kernel stack to the thread struct once we have MSR[RI] back on. Suggested-by: Breno Leitao <leitao@debian.org> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent cf13435
File | Mode | Size |
---|---|---|
Makefile | -rw-r--r-- | 361 bytes |
compat.c | -rw-r--r-- | 2.2 KB |
ipc_sysctl.c | -rw-r--r-- | 5.4 KB |
mq_sysctl.c | -rw-r--r-- | 2.9 KB |
mqueue.c | -rw-r--r-- | 39.0 KB |
msg.c | -rw-r--r-- | 29.9 KB |
msgutil.c | -rw-r--r-- | 3.6 KB |
namespace.c | -rw-r--r-- | 4.6 KB |
sem.c | -rw-r--r-- | 61.4 KB |
shm.c | -rw-r--r-- | 42.4 KB |
syscall.c | -rw-r--r-- | 4.7 KB |
util.c | -rw-r--r-- | 22.1 KB |
util.h | -rw-r--r-- | 8.8 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...