From: Steven Rostedt on
On Fri, 2010-07-09 at 14:52 -0700, David Daney wrote:
> I found this issue in a locally patched 2.6.32.x, current kernels have
> moved the offending code to an __init function which is skipped by
> recordmcount.pl, so the bug is not currently being exercised.
> However, I think the patch is still a good idea, to avoid future
> problems if _mcount were to ever have its address taken in normal
> code.
>
> This is what I originally saw:
>
> Although arch/mips/kernel/ftrace.c is built without -pg, and thus
> contains no calls to _mcount, it does use the address of _mcount
> in ftrace_make_nop(). This was causing relocations to be emitted
> for _mcount which recordmcount.pl erronously took to be _mcount
> call sites. The result was that the text of ftrace_make_nop()
> would be patched with garbage leading to a system crash.
>
> In non-module code, all _mcount call sites will have R_MIPS_26
> relocations, so we restrict $mcount_regex to only match on these.
>

I'd like to get an Acked-by from Ralf and Wu before pulling this.

Thanks,

-- Steve

> Signed-off-by: David Daney <ddaney(a)caviumnetworks.com>
> Cc: Steven Rostedt <rostedt(a)goodmis.org>
> Cc: Li Hong <lihong.hi(a)gmail.com>
> Cc: Ingo Molnar <mingo(a)elte.hu>
> Cc: Matt Fleming <matt(a)console-pimps.org>
> Cc: Ralf Baechle <ralf(a)linux-mips.org>
> ---
> scripts/recordmcount.pl | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
> index f3c9c0a..0171060 100755
> --- a/scripts/recordmcount.pl
> +++ b/scripts/recordmcount.pl
> @@ -326,7 +326,7 @@ if ($arch eq "x86_64") {
> # 14: R_MIPS_NONE *ABS*
> # 18: 00020021 nop
> if ($is_module eq "0") {
> - $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
> + $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_26\\s+_mcount\$";
> } else {
> $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_HI16\\s+_mcount\$";
> }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Ralf Baechle on
On Fri, Jul 09, 2010 at 08:26:02PM -0400, Steven Rostedt wrote:

> I'd like to get an Acked-by from Ralf and Wu before pulling this.

I talked through this on irc with David and it is the right thing to do.

Acked-by: Ralf Baechle <ralf(a)linux-mips.org>

Ralf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Wu Zhangjin on
On Fri, 2010-07-09 at 20:26 -0400, Steven Rostedt wrote:
>
> I'd like to get an Acked-by from Ralf and Wu before pulling this.
>

It is ok for me ;)

Acked-by: Wu Zhangjin <wuzhangjin(a)gmail.com>

Regards,
Wu Zhangjin

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