x86/asm/efi: Create a stack frame in efi_call()
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 21 Jan 2016 22:49:23 +0000 (16:49 -0600)
committerIngo Molnar <mingo@kernel.org>
Wed, 24 Feb 2016 07:35:43 +0000 (08:35 +0100)
efi_call() is a callable non-leaf function which doesn't honor
CONFIG_FRAME_POINTER, which can result in bad stack traces.

Create a stack frame for it when CONFIG_FRAME_POINTER is enabled.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk>
Reviewed-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Chris J Arges <chris.j.arges@canonical.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Pedro Alves <palves@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: live-patching@vger.kernel.org
Link: http://lkml.kernel.org/r/2294b6fad60eea4cc862eddc8e98a1324e6eeeca.1453405861.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/platform/efi/efi_stub_64.S

index 86d0f9e08dd95eb1023d5ac7ec4fb006aafb72c9..0df2dcc18404315661ef68517d5b3ca78cbd06bf 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/msr.h>
 #include <asm/processor-flags.h>
 #include <asm/page_types.h>
+#include <asm/frame.h>
 
 #define SAVE_XMM                       \
        mov %rsp, %rax;                 \
@@ -74,6 +75,7 @@
        .endm
 
 ENTRY(efi_call)
+       FRAME_BEGIN
        SAVE_XMM
        mov (%rsp), %rax
        mov 8(%rax), %rax
@@ -88,6 +90,7 @@ ENTRY(efi_call)
        RESTORE_PGT
        addq $48, %rsp
        RESTORE_XMM
+       FRAME_END
        ret
 ENDPROC(efi_call)
 
This page took 0.043111 seconds and 5 git commands to generate.