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] [day] [month] [year] [list]
Message-ID: <tip-a484e54fae891703cbe1c9ec1b536605f11f5482@git.kernel.org>
Date:	Fri, 23 Jul 2010 12:11:38 GMT
From:	tip-bot for David Daney <ddaney@...iumnetworks.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	lihong.hi@...il.com, linux-kernel@...r.kernel.org, hpa@...or.com,
	mingo@...hat.com, wuzhangjin@...il.com, rostedt@...dmis.org,
	ralf@...ux-mips.org, matt@...sole-pimps.org,
	ddaney@...iumnetworks.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/core] tracing: Fix $mcount_regex for MIPS in recordmcount.pl

Commit-ID:  a484e54fae891703cbe1c9ec1b536605f11f5482
Gitweb:     http://git.kernel.org/tip/a484e54fae891703cbe1c9ec1b536605f11f5482
Author:     David Daney <ddaney@...iumnetworks.com>
AuthorDate: Fri, 9 Jul 2010 14:52:05 -0700
Committer:  Steven Rostedt <rostedt@...dmis.org>
CommitDate: Thu, 22 Jul 2010 14:55:43 -0400

tracing: Fix $mcount_regex for MIPS in recordmcount.pl

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.

Acked-by: Ralf Baechle <ralf@...ux-mips.org>
Acked-by: Wu Zhangjin <wuzhangjin@...il.com>
Signed-off-by: David Daney <ddaney@...iumnetworks.com>
LKML-Reference: <1278712325-12050-1-git-send-email-ddaney@...iumnetworks.com>
Cc: Li Hong <lihong.hi@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Matt Fleming <matt@...sole-pimps.org>
Signed-off-by: Steven Rostedt <rostedt@...dmis.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@...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