Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1227888

Re: [PATCH 1/3] x86/uaccess: Add stack frame output operand in get_user inline asm

Path csiph.com!au2pb.net!us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!bofh.it!news.nic.it!robomod
From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] x86/uaccess: Add stack frame output operand in get_user inline asm
Date Fri, 18 Sep 2015 16:00:03 +0200
Message-ID <qa4mL-4oE-31@gated-at.bofh.it> (permalink)
References <q6NBL-4jS-3@gated-at.bofh.it> <q9PH3-g0-3@gated-at.bofh.it> <q9PH4-g0-25@gated-at.bofh.it>
X-Original-To Chris J Arges <chris.j.arges@canonical.com>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
User-Agent Mutt/1.5.23.1-rc1 (2014-03-12)
X-Scanned-By MIMEDefang 2.68 on 10.5.11.24
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, 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, David Hildenbrand <dahi@linux.vnet.ibm.com>, "Michael S. Tsirkin" <mst@redhat.com>
X-Original-Date Fri, 18 Sep 2015 08:57:05 -0500
X-Original-Message-ID <20150918135705.GH21027@treble.hsd1.ky.comcast.net>
X-Original-References <cover.1441749989.git.jpoimboe@redhat.com> <1442528077-11118-1-git-send-email-chris.j.arges@canonical.com> <1442528077-11118-2-git-send-email-chris.j.arges@canonical.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1227888

Show key headers only | View raw


On Thu, Sep 17, 2015 at 05:14:35PM -0500, Chris J Arges wrote:
> 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 <chris.j.arges@canonical.com>

Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>

> ---
>  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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v12 00/21] Compile-time stack metadata validation Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:30 +0200
  [PATCH v12 16/21] x86/asm/crypto: Create stack frames in clmul_ghash_mul/update() Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:40 +0200
  [PATCH v12 21/21] x86/asm/power: Create stack frames in hibernate_asm_64.S Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:40 +0200
  [PATCH v12 15/21] x86/asm/crypto: Move jump_table to .rodata section Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:40 +0200
  [PATCH v12 17/21] x86/asm/entry: Create stack frames in thunk functions Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:40 +0200
  [PATCH v12 05/21] x86/stacktool: Add file and directory ignores Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:40 +0200
  [PATCH v12 19/21] x86/asm: Create stack frames in rwsem functions Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:40 +0200
  [PATCH v12 18/21] x86/asm/acpi: Create a stack frame in do_suspend_lowlevel() Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:40 +0200
  [PATCH v12 20/21] x86/asm/efi: Create a stack frame in efi_call() Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-09 15:40 +0200
  Re: [PATCH v12 00/21] Compile-time stack metadata validation Chris J Arges <chris.j.arges@canonical.com> - 2015-09-15 19:00 +0200
    Re: [PATCH v12 00/21] Compile-time stack metadata validation Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-15 20:20 +0200
  [PATCH 3/3] kprobes/x86: stacktool: ignore kretprobe_trampoline_holder Chris J Arges <chris.j.arges@canonical.com> - 2015-09-18 00:20 +0200
    Re: [PATCH 3/3] kprobes/x86: stacktool: ignore  kretprobe_trampoline_holder Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-18 16:10 +0200
  [PATCH 2/3] x86/stacktool: Ignore head_$(BITS) files. Chris J Arges <chris.j.arges@canonical.com> - 2015-09-18 00:20 +0200
    Re: [PATCH 2/3] x86/stacktool: Ignore head_$(BITS) files. Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-18 16:00 +0200
  [PATCH 1/3] x86/uaccess: Add stack frame output operand in get_user inline asm Chris J Arges <chris.j.arges@canonical.com> - 2015-09-18 00:20 +0200
    Re: [PATCH 1/3] x86/uaccess: Add stack frame output operand in  get_user inline asm Josh Poimboeuf <jpoimboe@redhat.com> - 2015-09-18 16:00 +0200
  [PATCH 0/3] A few stacktool warning fixes. Chris J Arges <chris.j.arges@canonical.com> - 2015-09-18 00:20 +0200

csiph-web