mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Chris J Arges <chris.j.arges@canonical.com>
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>
Subject: Re: [PATCH 1/3] x86/uaccess: Add stack frame output operand in get_user inline asm
Date: Fri, 18 Sep 2015 08:57:05 -0500	[thread overview]
Message-ID: <20150918135705.GH21027@treble.hsd1.ky.comcast.net> (raw)
In-Reply-To: <1442528077-11118-2-git-send-email-chris.j.arges@canonical.com>

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
> 

  reply	other threads:[~2015-09-18 13:57 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 13:21 [PATCH v12 00/21] Compile-time stack metadata validation Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 01/21] tools: Fix formatting of the "make -C tools" help message Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 02/21] x86/asm: Frame pointer macro cleanup Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 03/21] x86/asm: Add C versions of frame pointer macros Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 04/21] x86/stacktool: Compile-time stack metadata validation Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 05/21] x86/stacktool: Add file and directory ignores Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 06/21] x86/stacktool: Add ignore macros Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 07/21] x86/xen: Add stack frame dependency to hypercall inline asm calls Josh Poimboeuf
2015-09-09 13:30   ` David Vrabel
2015-09-09 13:21 ` [PATCH v12 08/21] x86/paravirt: Add stack frame dependency to PVOP " Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 09/21] x86/paravirt: Create a stack frame in PV_CALLEE_SAVE_REGS_THUNK Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 10/21] x86/amd: Set ELF function type for vide() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 11/21] x86/reboot: Add ljmp instructions to stacktool whitelist Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 12/21] x86/xen: Add xen_cpuid() and xen_setup_gdt() to stacktool whitelists Josh Poimboeuf
2015-09-09 13:31   ` David Vrabel
2015-09-09 13:21 ` [PATCH v12 13/21] x86/asm/crypto: Create stack frames in aesni-intel_asm.S Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 14/21] x86/asm/crypto: Move .Lbswap_mask data to .rodata section Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 15/21] x86/asm/crypto: Move jump_table " Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 16/21] x86/asm/crypto: Create stack frames in clmul_ghash_mul/update() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 17/21] x86/asm/entry: Create stack frames in thunk functions Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 18/21] x86/asm/acpi: Create a stack frame in do_suspend_lowlevel() Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 19/21] x86/asm: Create stack frames in rwsem functions Josh Poimboeuf
2015-09-09 13:21 ` [PATCH v12 20/21] x86/asm/efi: Create a stack frame in efi_call() Josh Poimboeuf
2015-09-09 13:22 ` [PATCH v12 21/21] x86/asm/power: Create stack frames in hibernate_asm_64.S Josh Poimboeuf
2015-09-15 16:57 ` [PATCH v12 00/21] Compile-time stack metadata validation Chris J Arges
2015-09-15 18:11   ` Josh Poimboeuf
2015-09-17 22:14 ` [PATCH 0/3] A few stacktool warning fixes Chris J Arges
2015-09-17 22:14   ` [PATCH 1/3] x86/uaccess: Add stack frame output operand in get_user inline asm Chris J Arges
2015-09-18 13:57     ` Josh Poimboeuf [this message]
2015-09-17 22:14   ` [PATCH 2/3] x86/stacktool: Ignore head_$(BITS) files Chris J Arges
2015-09-18 13:57     ` Josh Poimboeuf
2015-09-17 22:14   ` [PATCH 3/3] kprobes/x86: stacktool: ignore kretprobe_trampoline_holder Chris J Arges
2015-09-18 14:04     ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150918135705.GH21027@treble.hsd1.ky.comcast.net \
    --to=jpoimboe@redhat.com \
    --cc=akataria@vmware.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=bernd@petrovitsch.priv.at \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=chris.j.arges@canonical.com \
    --cc=chrisw@sous-sol.org \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=david.vrabel@citrix.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@redhat.com \
    --cc=mmarek@suse.cz \
    --cc=mst@redhat.com \
    --cc=namhyung@gmail.com \
    --cc=palves@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®