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>] [day] [month] [year] [list]
Message-Id: <1428483228-5232-1-git-send-email-juri.lelli@arm.com>
Date:	Wed,  8 Apr 2015 09:53:48 +0100
From:	Juri Lelli <juri.lelli@....com>
To:	joe@...ches.com
Cc:	linux-kernel@...r.kernel.org, Juri Lelli <juri.lelli@....com>,
	Andy Whitcroft <apw@...onical.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Juri Lelli <juri.lelli@...il.com>
Subject: [PATCH v2] scripts/checkpatch: check for uses of trace_printk

Production kernels will scream if trace_printk() is used (thanks to
Steve's banner). Rather than waiting for that to happen, let's check
patches beforehand.

Signed-off-by: Juri Lelli <juri.lelli@....com>
Cc: Andy Whitcroft <apw@...onical.com>
Cc: Joe Perches <joe@...ches.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Juri Lelli <juri.lelli@...il.com>
Cc: linux-kernel@...r.kernel.org
---
Changes since v1:

 o added an exception when the code is in kernel/trace/, as suggested
   by Steve and Joe;

 scripts/checkpatch.pl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d124359..c36b2b7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3257,6 +3257,13 @@ sub process {
 			     "Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit\n" . $herecurr);
 		}
 
+# check for uses of trace_printk
+		if ($realfile !~ m@...nel/trace/@ &&
+		    $line =~ /\btrace_printk\s*\(/) {
+			ERROR("TRACE_PRINTK",
+			      "Never use trace_printk in production code!\n" . $herecurr);
+		}
+
 # printk should use KERN_* levels.  Note that follow on printk's on the
 # same line do not need a level, so we use the current block context
 # to try and find and validate the current printk.  In summary the current
-- 
2.3.0

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