From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759763AbcBYFvr (ORCPT ); Thu, 25 Feb 2016 00:51:47 -0500 Received: from torg.zytor.com ([198.137.202.12]:54082 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759368AbcBYFvp (ORCPT ); Thu, 25 Feb 2016 00:51:45 -0500 Date: Wed, 24 Feb 2016 21:50:32 -0800 From: tip-bot for Chris J Arges Message-ID: Cc: luto@kernel.org, brgerst@gmail.com, acme@kernel.org, dvlasenk@redhat.com, peterz@infradead.org, bernd@petrovitsch.priv.at, jslaby@suse.cz, luto@amacapital.net, palves@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, mmarek@suse.cz, akpm@linux-foundation.org, namhyung@gmail.com, bp@alien8.de, bp@suse.de, jpoimboe@redhat.com, torvalds@linux-foundation.org, tglx@linutronix.de, chris.j.arges@canonical.com, mingo@kernel.org Reply-To: torvalds@linux-foundation.org, namhyung@gmail.com, akpm@linux-foundation.org, bp@suse.de, jpoimboe@redhat.com, bp@alien8.de, mingo@kernel.org, chris.j.arges@canonical.com, tglx@linutronix.de, luto@kernel.org, acme@kernel.org, brgerst@gmail.com, palves@redhat.com, mmarek@suse.cz, hpa@zytor.com, linux-kernel@vger.kernel.org, bernd@petrovitsch.priv.at, peterz@infradead.org, jslaby@suse.cz, luto@amacapital.net, dvlasenk@redhat.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/debug] x86/uaccess: Add stack frame output operand in get_user() inline asm Git-Commit-ID: f05058c4d652b619adfda6c78d8f5b341169c264 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f05058c4d652b619adfda6c78d8f5b341169c264 Gitweb: http://git.kernel.org/tip/f05058c4d652b619adfda6c78d8f5b341169c264 Author: Chris J Arges AuthorDate: Thu, 21 Jan 2016 16:49:25 -0600 Committer: Ingo Molnar CommitDate: Wed, 24 Feb 2016 08:35:43 +0100 x86/uaccess: Add stack frame output operand in get_user() inline asm Numerous 'call without frame pointer save/setup' warnings are introduced by stacktool because of functions using the get_user() macro. Bad stack traces could occur due to lack of or misplacement of stack frame setup code. This patch forces a stack frame to be created before the inline asm code if CONFIG_FRAME_POINTER is enabled by listing the stack pointer as an output operand for the get_user() inline assembly statement. Signed-off-by: Chris J Arges 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: 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/bc85501f221ee512670797c7f110022e64b12c81.1453405861.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/uaccess.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index a4a30e4..9bbb3b2 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -179,10 +179,11 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) ({ \ int __ret_gu; \ register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX); \ + register void *__sp asm(_ASM_SP); \ __chk_user_ptr(ptr); \ might_fault(); \ - asm volatile("call __get_user_%P3" \ - : "=a" (__ret_gu), "=r" (__val_gu) \ + asm volatile("call __get_user_%P4" \ + : "=a" (__ret_gu), "=r" (__val_gu), "+r" (__sp) \ : "0" (ptr), "i" (sizeof(*(ptr)))); \ (x) = (__force __typeof__(*(ptr))) __val_gu; \ __builtin_expect(__ret_gu, 0); \