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:	Tue, 07 Jun 2011 11:08:03 -0700
From:	David Daney <ddaney.cavm@...il.com>
To:	Steven Rostedt <rostedt@...dmis.org>
CC:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Subject: Re: [PATCH 2/3] kprobes/trace: Fix kprobe selftest for gcc 4.6

On 06/07/2011 10:07 AM, Steven Rostedt wrote:
> From: Steven Rostedt<srostedt@...hat.com>
>
> With gcc 4.6, the self test kprobe function:
>
>   kprobe_trace_selftest_target()
>
> is optimized such that kallsyms does not list it. The kprobes
> test uses this function to insert a probe and test it. But
> it will fail the test if the function is not listed in kallsyms.
>
> Because the name is rather unique, converting it from static to
> global should not be a problem. This prevents gcc from removing
> it from kallsyms.
>
> Cc: Masami Hiramatsu<masami.hiramatsu.pt@...achi.com>
> Signed-off-by: Steven Rostedt<rostedt@...dmis.org>
> ---
>   kernel/trace/trace_kprobe.c |    8 ++++++--
>   1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index f925c45..2c14378 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -1870,8 +1870,12 @@ fs_initcall(init_kprobe_trace);
>
>   #ifdef CONFIG_FTRACE_STARTUP_TEST
>
> -static int kprobe_trace_selftest_target(int a1, int a2, int a3,
> -					int a4, int a5, int a6)
> +/*
> + * Can't be static, otherwise gcc might optimize this to
> + * not be in the kallsyms table.
> + */

Could you make it '__used' instead?

David Daney


> +int kprobe_trace_selftest_target(int a1, int a2, int a3,
> +				 int a4, int a5, int a6)
>   {
>   	return a1 + a2 + a3 + a4 + a5 + a6;
>   }

--
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