summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/unwind_orc.c
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2020-08-10 07:07:46 +0300
committerJoel Stanley <joel@jms.id.au>2020-08-10 07:07:49 +0300
commit4789fd48a313d36fe6b8fc1da5e0788f5ea074cb (patch)
tree2c8c27b52f0e38abb7416ce81b04c3b85511b694 /arch/x86/kernel/unwind_orc.c
parent8a9b346382056b52cd7ff141ae9f15a0fcfeb13d (diff)
parentd9939285fc818425ae92bd99f8c97b6b9ef3bb88 (diff)
downloadlinux-4789fd48a313d36fe6b8fc1da5e0788f5ea074cb.tar.xz
Merge tag 'v5.4.57' into dev-5.4dev-5.4
This is the 5.4.57 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'arch/x86/kernel/unwind_orc.c')
-rw-r--r--arch/x86/kernel/unwind_orc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index aa0f39dc8129..187a86e0e753 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -431,8 +431,11 @@ bool unwind_next_frame(struct unwind_state *state)
/*
* Find the orc_entry associated with the text address.
*
- * Decrement call return addresses by one so they work for sibling
- * calls and calls to noreturn functions.
+ * For a call frame (as opposed to a signal frame), state->ip points to
+ * the instruction after the call. That instruction's stack layout
+ * could be different from the call instruction's layout, for example
+ * if the call was to a noreturn function. So get the ORC data for the
+ * call instruction itself.
*/
orc = orc_find(state->signal ? state->ip : state->ip - 1);
if (!orc) {
@@ -653,6 +656,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
state->sp = task->thread.sp;
state->bp = READ_ONCE_NOCHECK(frame->bp);
state->ip = READ_ONCE_NOCHECK(frame->ret_addr);
+ state->signal = (void *)state->ip == ret_from_fork;
}
if (get_stack_info((unsigned long *)state->sp, state->task,