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  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]
Date:   Thu, 23 Feb 2017 09:56:44 -0600
From:   Rob Herring <robh@...nel.org>
To:     devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>
Subject: [PATCH] checkpatch.pl: Add SPDX license tag check for dts files and headers

Add a check for using SPDX-License-Identifier tags to define the license of
.dts{i} and DT header files rather than using free form license text. This
check looks for GPL, BSD, or X11(really incorrectly labeled MIT license)
license text which are the commonly used DT licenses.

Signed-off-by: Rob Herring <robh@...nel.org>
Cc: Andy Whitcroft <apw@...onical.com>
Cc: Joe Perches <joe@...ches.com>
---
 scripts/checkpatch.pl | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 982c52ca6473..ce802b3146e3 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2139,6 +2139,7 @@ sub process {
 	my $commit_log_has_diff = 0;
 	my $reported_maintainer_file = 0;
 	my $non_utf8_charset = 0;
+	my $licensefile = '';
 
 	my $last_blank_line = 0;
 	my $last_coalesced_string_linenr = -1;
@@ -2805,6 +2806,18 @@ sub process {
 			}
 		}
 
+# check for using SPDX tag instead of free form license text in dts and binding header files
+		if ($licensefile ne $realfile &&
+		    ($realfile =~ /\.dtsi?$/ || $realfile =~ /dt-bindings\/.*\.h$/) &&
+		    $rawline !~ /\bSPDX-License-Identifier/ &&
+		    ($rawline =~ /^\+.*\bGeneral\s+Public\s+License/i ||
+		    $rawline =~ /^\+.*\bTHE\s+SOFTWARE\s+IS\s+PROVIDED\s+\"AS\s+IS\"/i ||
+		    $rawline =~ /^\+.*\b(GPL|BSD|X11)/)) {
+			$licensefile = $realfile;
+			WARN("SPDX_LICENSE_TAG",
+			     "Use SPDX-License-Identifier tags instead of full license text\n" . $herecurr);
+		}
+
 # check we are in a valid source file if not then ignore this hunk
 		next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/);
 
-- 
2.10.1

Powered by blists - more mailing lists