diff options
-rw-r--r-- | arch/x86/kernel/unwind_frame.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kernel/unwind_frame.c b/arch/x86/kernel/unwind_frame.c index ea7b7f9a3b9e..33aeaae961aa 100644 --- a/arch/x86/kernel/unwind_frame.c +++ b/arch/x86/kernel/unwind_frame.c | |||
@@ -46,7 +46,14 @@ static bool is_last_task_frame(struct unwind_state *state) | |||
46 | unsigned long bp = (unsigned long)state->bp; | 46 | unsigned long bp = (unsigned long)state->bp; |
47 | unsigned long regs = (unsigned long)task_pt_regs(state->task); | 47 | unsigned long regs = (unsigned long)task_pt_regs(state->task); |
48 | 48 | ||
49 | return bp == regs - FRAME_HEADER_SIZE; | 49 | /* |
50 | * We have to check for the last task frame at two different locations | ||
51 | * because gcc can occasionally decide to realign the stack pointer and | ||
52 | * change the offset of the stack frame by a word in the prologue of a | ||
53 | * function called by head/entry code. | ||
54 | */ | ||
55 | return bp == regs - FRAME_HEADER_SIZE || | ||
56 | bp == regs - FRAME_HEADER_SIZE - sizeof(long); | ||
50 | } | 57 | } |
51 | 58 | ||
52 | /* | 59 | /* |