From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754350AbcBWJF0 (ORCPT ); Tue, 23 Feb 2016 04:05:26 -0500 Received: from terminus.zytor.com ([198.137.202.10]:57378 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751432AbcBWJFS (ORCPT ); Tue, 23 Feb 2016 04:05:18 -0500 Date: Tue, 23 Feb 2016 01:00:13 -0800 From: =?UTF-8?B?dGlwLWJvdCBmb3IgSm9zaCBQb2ltYm9ldWYgPHRpcGJvdEB6eXRvci5jb20+?=@zytor.com Message-ID: Cc: jslaby@suse.cz, peterz@infradead.org, acme@kernel.org, tglx@linutronix.de, bp@alien8.de, mmarek@suse.cz, palves@redhat.com, mingo@kernel.org, torvalds@linux-foundation.org, bernd@petrovitsch.priv.at, luto@amacapital.net, brgerst@gmail.com, linux-kernel@vger.kernel.org, chris.j.arges@canonical.com, luto@kernel.org, hpa@zytor.com, jpoimboe@redhat.com, bp@suse.de, namhyung@gmail.com, akpm@linux-foundation.org, dvlasenk@redhat.com Reply-To: peterz@infradead.org, jslaby@suse.cz, linux-kernel@vger.kernel.org, chris.j.arges@canonical.com, brgerst@gmail.com, luto@amacapital.net, bernd@petrovitsch.priv.at, palves@redhat.com, torvalds@linux-foundation.org, mingo@kernel.org, mmarek@suse.cz, bp@alien8.de, tglx@linutronix.de, acme@kernel.org, hpa@zytor.com, luto@kernel.org, dvlasenk@redhat.com, akpm@linux-foundation.org, bp@suse.de, namhyung@gmail.com, jpoimboe@redhat.com In-Reply-To: <4373e5bff459b9fd66ce5d45bfcc881a5c202643.1453405861.git.jpoimboe@redhat.com> References: <4373e5bff459b9fd66ce5d45bfcc881a5c202643.1453405861.git.jpoimboe@redhat.com> To: =?UTF-8?B?bGludXgtdGlwLWNvbW1pdHNAdmdlci5rZXJuZWwub3Jn?=@zytor.com Subject: =?UTF-8?B?W3RpcDp4ODYvZGVidWddIHg4Ni9hc20vZW50cnk6IENyZWF0ZSBzdGFjayBmcmE=?= =?UTF-8?B?bWVzIGluIHRodW5rIGZ1bmN0aW9ucw==?= Git-Commit-ID: =?UTF-8?B?YjQwNGIyYzRhMWY5OGFkMzRjMzNmNDVhMjU0YzMxZDRmY2E5ZDkxZA==?= X-Mailer: =?UTF-8?B?dGlwLWdpdC1sb2ctZGFlbW9u?= Robot-ID: =?UTF-8?B?PHRpcC1ib3QuZ2l0Lmtlcm5lbC5vcmc+?= Robot-Unsubscribe: =?UTF-8?B?Q29udGFjdCA8bWFpbHRvOmhwYUBrZXJuZWwub3JnPiB0byBnZXQgYmxhY2tsaXM=?= =?UTF-8?B?dGVkIGZyb20gdGhlc2UgZW1haWxz?= MIME-Version: =?UTF-8?B?MS4w?= Content-Transfer-Encoding: =?UTF-8?B?OGJpdA==?= Content-Type: =?UTF-8?B?dGV4dC9wbGFpbjsgY2hhcnNldD1VVEYtOA==?= Content-Disposition: =?UTF-8?B?aW5saW5l?= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b404b2c4a1f98ad34c33f45a254c31d4fca9d91d Gitweb: http://git.kernel.org/tip/b404b2c4a1f98ad34c33f45a254c31d4fca9d91d Author: Josh Poimboeuf AuthorDate: Thu, 21 Jan 2016 16:49:20 -0600 Committer: Ingo Molnar 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 Reviewed-by: Borislav Petkov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Brian Gerst Cc: Chris J Arges Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/4373e5bff459b9fd66ce5d45bfcc881a5c202643.1453405861.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- 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 #include "calling.h" #include +#include /* 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