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:   Sat, 16 Nov 2019 21:46:07 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-tip-commits@...r.kernel.org,
        Alexei Starovoitov <ast@...nel.org>,
        "Steven Rostedt (VMware)" <rostedt@...dmis.org>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Andy Lutomirski <luto@...nel.org>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [tip: core/kprobes] x86/ftrace: Use text_poke()

On Fri, Nov 15, 2019 at 09:43:10AM -0000, tip-bot2 for Peter Zijlstra wrote:
> The following commit has been merged into the core/kprobes branch of tip:
> 
> Commit-ID:     9706f7c3531fee00505ebd03bf3aa0af76510877
> Gitweb:        https://git.kernel.org/tip/9706f7c3531fee00505ebd03bf3aa0af76510877
> Author:        Peter Zijlstra <peterz@...radead.org>
> AuthorDate:    Mon, 26 Aug 2019 14:48:23 +02:00
> Committer:     Ingo Molnar <mingo@...nel.org>
> CommitterDate: Fri, 15 Nov 2019 09:07:42 +01:00
> 
> x86/ftrace: Use text_poke()
> 
> Move ftrace over to using the generic x86 text_poke functions; this
> avoids having a second/different copy of that code around.
> 
> This also avoids ftrace violating the (new) W^X rule and avoids
> fragmenting the kernel text page-tables, due to no longer having to
> toggle them RW.
> 
> Tested-by: Alexei Starovoitov <ast@...nel.org>
> Tested-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> Reviewed-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
> Acked-by: Alexei Starovoitov <ast@...nel.org>
> Cc: Andy Lutomirski <luto@...nel.org>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Daniel Bristot de Oliveira <bristot@...hat.com>
> Cc: H. Peter Anvin <hpa@...or.com>
> Cc: Josh Poimboeuf <jpoimboe@...hat.com>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Link: https://lkml.kernel.org/r/20191111132457.761255803@infradead.org
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> ---
>  arch/x86/include/asm/ftrace.h |   2 +-
>  arch/x86/kernel/alternative.c |  18 +-
>  arch/x86/kernel/ftrace.c      | 663 +++++----------------------------
>  arch/x86/kernel/traps.c       |   9 +-
>  4 files changed, 134 insertions(+), 558 deletions(-)

...

> +static int
> +ftrace_modify_code_direct(unsigned long ip, const char *old_code,
> +			  const char *new_code)
> +{
> +	int ret = ftrace_verify_code(ip, old_code);
> +	if (ret)
> +		return ret;
>  
> +	/* replace the text with the new text */
> +	if (ftrace_poke_late)
> +		text_poke_queue((void *)ip, new_code, MCOUNT_INSN_SIZE, NULL);
> +	else
> +		text_poke_early((void *)ip, new_code, MCOUNT_INSN_SIZE);

Btw:

WARNING: vmlinux.o(.text+0x8c0b1): Section mismatch in reference from the function ftrace_modify_code_direct() to the function .init.text:text_poke_early()
The function ftrace_modify_code_direct() references
the function __init text_poke_early().
This is often because ftrace_modify_code_direct lacks a __init 
annotation or the annotation of text_poke_early is wrong.

FATAL: modpost: Section mismatches detected.
Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.
make[1]: *** [scripts/Makefile.modpost:66: __modpost] Error 1
make: *** [Makefile:1077: vmlinux] Error 2

random .config attached.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

View attachment ".config" of type "text/plain" (162489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ