[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-b404b2c4a1f98ad34c33f45a254c31d4fca9d91d@git.kernel.org>
Date: Tue, 23 Feb 2016 01:00:13 -0800
From: tip-bot for Josh Poimboeuf <tipbot@...or.com>@zytor.com
To: linux-tip-commits@...r.kernel.org@...or.com
Cc: jslaby@...e.cz, peterz@...radead.org, acme@...nel.org,
tglx@...utronix.de, bp@...en8.de, mmarek@...e.cz,
palves@...hat.com, mingo@...nel.org, torvalds@...ux-foundation.org,
bernd@...rovitsch.priv.at, luto@...capital.net, brgerst@...il.com,
linux-kernel@...r.kernel.org, chris.j.arges@...onical.com,
luto@...nel.org, hpa@...or.com, jpoimboe@...hat.com, bp@...e.de,
namhyung@...il.com, akpm@...ux-foundation.org, dvlasenk@...hat.com
Subject: [tip:x86/debug] x86/asm/entry: Create stack frames in thunk functions
Commit-ID: b404b2c4a1f98ad34c33f45a254c31d4fca9d91d
Gitweb: http://git.kernel.org/tip/b404b2c4a1f98ad34c33f45a254c31d4fca9d91d
Author: Josh Poimboeuf <jpoimboe@...hat.com>
AuthorDate: Thu, 21 Jan 2016 16:49:20 -0600
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 23 Feb 2016 09:03:57 +0100
x86/asm/entry: Create stack frames in thunk functions
Thunk functions are callable non-leaf functions that don't honor
CONFIG_FRAME_POINTER, which can result in bad stack traces. Also they
aren't annotated as ELF callable functions which can confuse tooling.
Create stack frames for them when CONFIG_FRAME_POINTER is enabled and
add the ELF function type.
Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
Reviewed-by: Borislav Petkov <bp@...e.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Bernd Petrovitsch <bernd@...rovitsch.priv.at>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Chris J Arges <chris.j.arges@...onical.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Jiri Slaby <jslaby@...e.cz>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Michal Marek <mmarek@...e.cz>
Cc: Namhyung Kim <namhyung@...il.com>
Cc: Pedro Alves <palves@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: live-patching@...r.kernel.org
Link: http://lkml.kernel.org/r/4373e5bff459b9fd66ce5d45bfcc881a5c202643.1453405861.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/entry/thunk_64.S | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S
index efb2b93..98df1fa 100644
--- a/arch/x86/entry/thunk_64.S
+++ b/arch/x86/entry/thunk_64.S
@@ -8,11 +8,14 @@
#include <linux/linkage.h>
#include "calling.h"
#include <asm/asm.h>
+#include <asm/frame.h>
/* rdi: arg1 ... normal C conventions. rax is saved/restored. */
.macro THUNK name, func, put_ret_addr_in_rdi=0
.globl \name
+ .type \name, @function
\name:
+ FRAME_BEGIN
/* this one pushes 9 elems, the next one would be %rIP */
pushq %rdi
@@ -62,6 +65,7 @@ restore:
popq %rdx
popq %rsi
popq %rdi
+ FRAME_END
ret
_ASM_NOKPROBE(restore)
#endif
Powered by blists - more mailing lists