From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbbIQWN0 (ORCPT ); Thu, 17 Sep 2015 18:13:26 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:41792 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009AbbIQWNY (ORCPT ); Thu, 17 Sep 2015 18:13:24 -0400 From: Chris J Arges To: x86@kernel.org, jpoimboe@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, mmarek@suse.cz, peterz@infradead.org, luto@kernel.org, bp@alien8.de, torvalds@linux-foundation.org, andi@firstfloor.org, palves@redhat.com, namhyung@gmail.com, bernd@petrovitsch.priv.at, akpm@linux-foundation.org, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, david.vrabel@citrix.com, jeremy@goop.org, chrisw@sous-sol.org, akataria@vmware.com, rusty@rustcorp.com.au, herbert@gondor.apana.org.au, davem@davemloft.net, pavel@ucw.cz, rjw@rjwysocki.net, len.brown@intel.com, matt.fleming@intel.com, Chris J Arges , David Hildenbrand , "Michael S. Tsirkin" Subject: [PATCH 1/3] x86/uaccess: Add stack frame output operand in get_user inline asm Date: Thu, 17 Sep 2015 17:14:35 -0500 Message-Id: <1442528077-11118-2-git-send-email-chris.j.arges@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442528077-11118-1-git-send-email-chris.j.arges@canonical.com> References: <1442528077-11118-1-git-send-email-chris.j.arges@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 a8df874..55b8db5 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h @@ -176,10 +176,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; \ __ret_gu; \ -- 1.9.1