lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 14 Nov 2013 13:07:35 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2] ftrace/x86: Load ftrace_ops in parameter not the
 variable holding it

(2013/11/14 5:20), Steven Rostedt wrote:
> 
> Function tracing callbacks expect to have the ftrace_ops that registered it
> passed to them, not the address of the variable that holds the ftrace_ops
> that registered it.
> 
> Use a mov instead of a lea to store the ftrace_ops into the parameter
> of the function tracing callback.

I see, function_trace_op is just a pointer to an actual ftrace_ops. :)
And I have ensured this change doesn't affect ftrace-kprobes since
it doesn't use this parameter.

> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>

Thank you,

> ---
>  arch/x86/kernel/entry_32.S | 4 ++--
>  arch/x86/kernel/entry_64.S | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
> index f0dcb0c..15a569a 100644
> --- a/arch/x86/kernel/entry_32.S
> +++ b/arch/x86/kernel/entry_32.S
> @@ -1085,7 +1085,7 @@ ENTRY(ftrace_caller)
>  	pushl $0	/* Pass NULL as regs pointer */
>  	movl 4*4(%esp), %eax
>  	movl 0x4(%ebp), %edx
> -	leal function_trace_op, %ecx
> +	movl function_trace_op, %ecx
>  	subl $MCOUNT_INSN_SIZE, %eax
>  
>  .globl ftrace_call
> @@ -1143,7 +1143,7 @@ ENTRY(ftrace_regs_caller)
>  	movl 12*4(%esp), %eax	/* Load ip (1st parameter) */
>  	subl $MCOUNT_INSN_SIZE, %eax	/* Adjust ip */
>  	movl 0x4(%ebp), %edx	/* Load parent ip (2nd parameter) */
> -	leal function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */
> +	movl function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */
>  	pushl %esp		/* Save pt_regs as 4th parameter */
>  
>  GLOBAL(ftrace_regs_call)
> diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> index b077f4c..9ce2567 100644
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -88,7 +88,7 @@ END(function_hook)
>  	MCOUNT_SAVE_FRAME \skip
>  
>  	/* Load the ftrace_ops into the 3rd parameter */
> -	leaq function_trace_op, %rdx
> +	movq function_trace_op(%rip), %rdx
>  
>  	/* Load ip into the first parameter */
>  	movq RIP(%rsp), %rdi
> 


-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ