diff options
author | Salman Qazi <sqazi@google.com> | 2012-10-01 17:29:25 -0700 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-11-02 11:29:36 -0400 |
commit | 28696f434fef0efa97534b59986ad33b9c4df7f8 (patch) | |
tree | 2b91ecd62ee6c82d727584b2753fa09c4094b1c6 /arch/x86/include/asm/ptrace.h | |
parent | 269833bd5a0f4443873da358b71675a890b47c3c (diff) | |
download | blackbird-op-linux-28696f434fef0efa97534b59986ad33b9c4df7f8.tar.gz blackbird-op-linux-28696f434fef0efa97534b59986ad33b9c4df7f8.zip |
x86: Don't clobber top of pt_regs in nested NMI
The nested NMI modifies the place (instruction, flags and stack)
that the first NMI will iret to. However, the copy of registers
modified is exactly the one that is the part of pt_regs in
the first NMI. This can change the behaviour of the first NMI.
In particular, Google's arch_trigger_all_cpu_backtrace handler
also prints regions of memory surrounding addresses appearing in
registers. This results in handled exceptions, after which nested NMIs
start coming in. These nested NMIs change the value of registers
in pt_regs. This can cause the original NMI handler to produce
incorrect output.
We solve this problem by interchanging the position of the preserved
copy of the iret registers ("saved") and the copy subject to being
trampled by nested NMI ("copied").
Link: http://lkml.kernel.org/r/20121002002919.27236.14388.stgit@dungbeetle.mtv.corp.google.com
Signed-off-by: Salman Qazi <sqazi@google.com>
[ Added a needed CFI_ADJUST_CFA_OFFSET ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch/x86/include/asm/ptrace.h')
0 files changed, 0 insertions, 0 deletions