]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: stacktrace: Report when we reach the end of the stack
authorMark Brown <broonie@kernel.org>
Wed, 24 Feb 2021 16:50:37 +0000 (16:50 +0000)
committerWill Deacon <will@kernel.org>
Thu, 25 Feb 2021 10:34:51 +0000 (10:34 +0000)
commit8b93c4ce390dde2e3e8ce2672614e33bf841f68c
tree4c784620c331d3d2f3d8ebb6e99811eb7fe8a523
parentd94eb6e998b1ab924b8bc089fcf83b442795cd03
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>
arch/arm64/kernel/stacktrace.c