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:   Fri, 18 Oct 2019 12:48:00 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     "tip-bot2 for Jiri Slaby" <tip-bot2@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
        Jiri Slaby <jslaby@...e.cz>, Borislav Petkov <bp@...e.de>,
        "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        linux-arch@...r.kernel.org, Masami Hiramatsu <mhiramat@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "x86-ml" <x86@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        Borislav Petkov <bp@...en8.de>
Subject: Re: [tip: x86/asm] x86/asm/ftrace: Mark function_hook as function

On Fri, 18 Oct 2019 16:30:27 -0000
"tip-bot2 for Jiri Slaby" <tip-bot2@...utronix.de> wrote:

> The following commit has been merged into the x86/asm branch of tip:
> 
> Commit-ID:     f13ad88a984e8090226a8f62d75e87b770eefdf4
> Gitweb:        https://git.kernel.org/tip/f13ad88a984e8090226a8f62d75e87b770eefdf4
> Author:        Jiri Slaby <jslaby@...e.cz>
> AuthorDate:    Fri, 11 Oct 2019 13:51:01 +02:00
> Committer:     Borislav Petkov <bp@...e.de>
> CommitterDate: Fri, 18 Oct 2019 11:35:41 +02:00

I just noticed this (sorry missed the original patch).

> 
> x86/asm/ftrace: Mark function_hook as function
> 
> Relabel function_hook to be marked really as a function. It is called
> from C and has the same expectations towards the stack etc.

This is wrong, function_hook is never called from C. It's called via
fentry (use to be mcount), and does not have the same semantics as a C
function. In fact, that's why it exists in assembly. Because it has to
save and restore registers to make it possible to call a C function!

-- Steve


> 
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> Signed-off-by: Borislav Petkov <bp@...e.de>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Josh Poimboeuf <jpoimboe@...hat.com>
> Cc: linux-arch@...r.kernel.org
> Cc: Masami Hiramatsu <mhiramat@...nel.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: x86-ml <x86@...nel.org>
> Link: https://lkml.kernel.org/r/20191011115108.12392-22-jslaby@suse.cz
> ---
>  arch/x86/kernel/ftrace_32.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/ftrace_32.S b/arch/x86/kernel/ftrace_32.S
> index e0061dc..219be13 100644
> --- a/arch/x86/kernel/ftrace_32.S
> +++ b/arch/x86/kernel/ftrace_32.S
> @@ -21,9 +21,9 @@ EXPORT_SYMBOL(__fentry__)
>  # define MCOUNT_FRAME			0	/* using frame = false */
>  #endif
>  
> -ENTRY(function_hook)
> +SYM_FUNC_START(function_hook)
>  	ret
> -END(function_hook)
> +SYM_FUNC_END(function_hook)
>  
>  ENTRY(ftrace_caller)
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ