summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/stacktrace.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2021-02-24 17:50:37 +0100
committerWill Deacon <will@kernel.org>2021-02-25 11:34:51 +0100
commit3c02600144bdb0a1280a9090d3a7e37e2f9fdcc8 (patch)
tree4c784620c331d3d2f3d8ebb6e99811eb7fe8a523 /arch/arm64/kernel/stacktrace.c
parentarm64: ptrace: Fix seccomp of traced syscall -1 (NO_SYSCALL) (diff)
downloadlinux-3c02600144bdb0a1280a9090d3a7e37e2f9fdcc8.tar.xz
linux-3c02600144bdb0a1280a9090d3a7e37e2f9fdcc8.zip
arm64: stacktrace: Report when we reach the end of the stack
Currently the arm64 unwinder code returns -EINVAL whenever it can't find the next stack frame, not distinguishing between cases where the stack has been corrupted or is otherwise in a state it shouldn't be and cases where we have reached the end of the stack. At the minute none of the callers care what error code is returned but this will be important for reliable stack trace which needs to be sure that the stack is intact. Change to return -ENOENT in the case where we reach the bottom of the stack. The error codes from this function are only used in kernel, this particular code is chosen as we are indicating that we know there is no frame there. Signed-off-by: Mark Brown <broonie@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/r/20210224165037.24138-1-broonie@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/stacktrace.c')
-rw-r--r--arch/arm64/kernel/stacktrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
index 0fb42129b469..ad20981dfda4 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -46,7 +46,7 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame)
/* Terminal record; nothing to unwind */
if (!fp)
- return -EINVAL;
+ return -ENOENT;
if (fp & 0xf)
return -EINVAL;