summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/dumpstack.c
diff options
context:
space:
mode:
authorMiroslav Benes <mbenes@suse.cz>2019-11-27 19:35:19 +0100
committerVasily Gorbik <gor@linux.ibm.com>2019-11-30 10:52:48 +0100
commitbe2d11b2a1e86586ace9f6839a159b170b00f2b3 (patch)
tree5d01fcfa98aa73eb964d9729804e7d6d7d967bfe /arch/s390/kernel/dumpstack.c
parentbf018ee644897d7982e1b8dd8b15e97db6e1a4da (diff)
downloadlinux-be2d11b2a1e86586ace9f6839a159b170b00f2b3.tar.bz2
s390/unwind: add stack pointer alignment sanity checks
ABI requires SP to be aligned 8 bytes, report unwinding error otherwise. Link: https://lkml.kernel.org/r/20191106095601.29986-5-mbenes@suse.cz Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Tested-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/dumpstack.c')
-rw-r--r--arch/s390/kernel/dumpstack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c
index d74e21a23703..d306fe04489a 100644
--- a/arch/s390/kernel/dumpstack.c
+++ b/arch/s390/kernel/dumpstack.c
@@ -94,6 +94,10 @@ int get_stack_info(unsigned long sp, struct task_struct *task,
if (!sp)
goto unknown;
+ /* Sanity check: ABI requires SP to be aligned 8 bytes. */
+ if (sp & 0x7)
+ goto unknown;
+
/* Check per-task stack */
if (in_task_stack(sp, task, info))
goto recursion_check;