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:   Wed, 27 Oct 2021 11:58:31 +0300
From:   Sergey Shtylyov <s.shtylyov@....ru>
To:     Steven Rostedt <rostedt@...dmis.org>,
        <linux-kernel@...r.kernel.org>
CC:     Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>, <linux-sh@...r.kernel.org>
Subject: Re: [for-next][PATCH 10/12] ftrace/sh: Add arch_ftrace_ops_list_func
 stub to have compressed image still link

On 26.10.2021 19:23, Steven Rostedt wrote:

> From: "linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>

    Collective author, really? :-)

> Using the linker script to fix an issue where some archs call the
> function tracer with just the ip (instruction pointer) and pip (parent
> instruction pointer) where as more up to date archs also pass in the
> associated ftrace_ops and the ftrace_regs pointer, the generic code
> will be called either with two parameters or four. To avoid any C
> undefined behavior of calling two parameters to four or four to two
> parameter function, two functions are created, where a preprocessor
> macro uses the one that matches the architecture. As the function
> pointers for them may be different, a typecast is used. But this
> triggers issues with newer compilers that will fail due to -Werror.
> 
> A linker trick is now used to map the generic function to the function
> that is used (note the generic function is only used to set the default
> function callback). The linker trick defines ftrace_ops_list_func (the
> generic function) to arch_ftrace_ops_list_func (the arch defined one).
> 
> Link: https://lore.kernel.org/all/20200617165616.52241bde@oasis.local.home/
> 
> But this fails sh arch because their linker script is included in their
> compressed image that does not define arch_ftrace_ops_list_func at all
> 
>    sh4-linux-ld:arch/sh/boot/compressed/../../kernel/vmlinux.lds:32: undefined symbol `arch_ftrace_ops_list_func' referenced in expression
> 
> Included a stub by that name in the misc.c to allow the code to
> compile and link, even though it's not used.
> 
> This is similar to what was done for ftrace_stub:
> 
>    b83b43ffc6e4b ("fgraph: Fix function type mismatches of
>    ftrace_graph_return using ftrace_stub")
> 
> Link: https://lkml.kernel.org/r/20211021221627.5d7270de@rorschach.local.home
> 
> Cc: Yoshinori Sato <ysato@...rs.sourceforge.jp>
> Cc: Rich Felker <dalias@...c.org>
> Cc: linux-sh@...r.kernel.org
> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
[...]

MBR, Sergey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ