diff options
author | Andi Kleen <ak@suse.de> | 2006-10-05 18:47:22 +0200 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-10-05 18:47:22 +0200 |
commit | 51ec28e1b2cb267a09a0b8eac1ccf8d61b7268bf (patch) | |
tree | 4686d439a49b98b98fc5048641ddfb50db3fbcd6 /arch/x86_64/kernel | |
parent | f015c6c4d733f68cbc1c5d231bb158abaa5c9606 (diff) | |
download | blackbird-op-linux-51ec28e1b2cb267a09a0b8eac1ccf8d61b7268bf.tar.gz blackbird-op-linux-51ec28e1b2cb267a09a0b8eac1ccf8d61b7268bf.zip |
[PATCH] x86: Terminate the kernel stacks for the unwinder
Always make sure RIP/EIP is 0 in the registers stored on the top
of the stack of a kernel thread. This makes sure the unwinder code
won't try a fallback but knows the stack has ended.
AK: this patch is a bit mysterious. in theory they should be terminated
anyways, but it seems to fix at least one crash. Anyways double termination
probably doesn't hurt.
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel')
-rw-r--r-- | arch/x86_64/kernel/entry.S | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index b8285cf1a9c3..ab9b2c4726f2 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S @@ -978,6 +978,11 @@ ENTRY(kernel_thread) call do_fork movq %rax,RAX(%rsp) xorl %edi,%edi + test %rax,%rax + jnz 1f + /* terminate stack in child */ + movq %rdi,RIP(%rsp) +1: /* * It isn't worth to check for reschedule here, |