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-next>] [day] [month] [year] [list]
Message-Id: <1486755469-21573-1-git-send-email-william.c.roberts@intel.com>
Date:   Fri, 10 Feb 2017 11:37:49 -0800
From:   william.c.roberts@...el.com
To:     linux-kernel@...r.kernel.org, joe@...ches.com, apw@...onical.com
Cc:     keescook@...omium.org, kernel-hardening@...ts.openwall.com,
        William Roberts <william.c.roberts@...el.com>
Subject: [PATCH] checkpatch: add warning on %pk instead of %pK usage

From: William Roberts <william.c.roberts@...el.com>

Sample output:
WARNING: %pk is close to %pK, did you mean %pK?.
\#20: FILE: drivers/char/applicom.c:230:
+			printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device. %pk\n", dev->irq, pci_get_class);

Signed-off-by: William Roberts <william.c.roberts@...el.com>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 982c52c..f20f5c5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6096,6 +6096,12 @@ sub process {
 			      "recursive locking is bad, do not use this ever.\n" . $herecurr);
 		}
 
+# check for bad %pK usage
+		if ($rawline =~ /\%pk/) {
+			WARN("FORMAT SPECIFIER",
+			      "%pk is close to %pK, did you mean %pK?.\n" . $herecurr);
+		}
+
 # check for lockdep_set_novalidate_class
 		if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ ||
 		    $line =~ /__lockdep_no_validate__\s*\)/ ) {
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ