]> git.baikalelectronics.ru Git - kernel.git/commit
x86/unwind/orc: Fix error handling in __unwind_start()
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 14 May 2020 20:31:10 +0000 (15:31 -0500)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 15 May 2020 08:35:08 +0000 (10:35 +0200)
commitd8fac08f5af6cda4321033708fe518c7082a39a7
treeb2bd84791c9e99317e70244bdcb6da2bd1e51465
parent8277a1075deebb892db94bab2ce18ec8bfe66b8e
x86/unwind/orc: Fix error handling in __unwind_start()

The unwind_state 'error' field is used to inform the reliable unwinding
code that the stack trace can't be trusted.  Set this field for all
errors in __unwind_start().

Also, move the zeroing out of the unwind_state struct to before the ORC
table initialization check, to prevent the caller from reading
uninitialized data if the ORC table is corrupted.

Fixes: 05da5bcc5f8b ("stacktrace/x86: add function for detecting reliable stack traces")
Fixes: a8be22bee6c7 ("x86/unwinder/orc: Dont bail on stack overflow")
Fixes: 6dc9ac7ea200 ("x86/unwind/orc: Prevent unwinding before ORC initialization")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/d6ac7215a84ca92b895fdd2e1aa546729417e6e6.1589487277.git.jpoimboe@redhat.com
arch/x86/kernel/unwind_orc.c