]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Mon, 22 Jun 2020 20:22:08 +0000 (17:22 -0300)
commit09974f5bf0017f114b934bf6c4b1b77097ae4267
treeca2a55a14dec7dd7ea016f5f89e1d11d736eb190
parent2563fd5e9ca51f4b0fe8518c1beb26911dad7e44
x86/unwind/orc: Fix error handling in __unwind_start()

BugLink: https://bugs.launchpad.net/bugs/1879759
commit 71c95825289f585014fe9741b051d32a7a916680 upstream.

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: af085d9084b4 ("stacktrace/x86: add function for detecting reliable stack traces")
Fixes: d3a09104018c ("x86/unwinder/orc: Dont bail on stack overflow")
Fixes: 98d0c8ebf77e ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/x86/kernel/unwind_orc.c