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] [thread-next>] [day] [month] [year] [list]
Message-Id: <1272316279-12042-2-git-send-email-npalix@diku.dk>
Date:	Mon, 26 Apr 2010 23:11:16 +0200
From:	Nicolas Palix <npalix@...u.dk>
To:	Andrew Morton <akpm@...ux-foundation.org>,
	Joe Perches <joe@...ches.com>,
	"David S. Miller" <davem@...emloft.net>,
	Michal Marek <mmarek@...e.cz>, Sam Ravnborg <sam@...nborg.org>,
	Julia Lawall <julia@...u.dk>,
	Gilles Muller <Gilles.Muller@...6.fr>,
	Nicolas Palix <npalix@...u.dk>, linux-kernel@...r.kernel.org,
	linux-kbuild@...r.kernel.org, cocci@...u.dk
Subject: [PATCH 1/4] Add targets to use the Coccinelle checker

Four targets are added. Each one generates a different
output kind: context, patch, org, report.
Every SmPL file in 'scripts/smpl' is given to the spatch frontend
(located in the 'scripts' directory), and applied to the entire
source tree.

Signed-off-by: Nicolas Palix <npalix@...u.dk>
---
 MAINTAINERS       |   10 ++++++++++
 Makefile          |    9 +++++++++
 scripts/spatch.sh |   14 ++++++++++++++
 3 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100755 scripts/spatch.sh

diff --git a/MAINTAINERS b/MAINTAINERS
index 3d29fa3..2aab763 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1533,6 +1533,16 @@ L:	platform-driver-x86@...r.kernel.org
 S:	Supported
 F:	drivers/platform/x86/classmate-laptop.c
 
+COCCINELLE
+M:	Julia Lawall <julia@...u.dk>
+M:	Gilles Muller <Gilles.Muller@...6.fr>
+M:	Nicolas Palix <npalix@...u.dk>
+L:	cocci@...u.dk
+W:	http://coccinelle.lip6.fr/
+S:	Supported
+F:	scripts/smpl/
+F:	scripts/spatch.sh
+
 CODA FILE SYSTEM
 M:	Jan Harkes <jaharkes@...cmu.edu>
 M:	coda@...cmu.edu
diff --git a/Makefile b/Makefile
index 67c1001..293c88b 100644
--- a/Makefile
+++ b/Makefile
@@ -325,6 +325,7 @@ INSTALLKERNEL  := installkernel
 DEPMOD		= /sbin/depmod
 KALLSYMS	= scripts/kallsyms
 PERL		= perl
+SPATCH          = spatch
 CHECK		= sparse
 
 CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
@@ -1424,6 +1425,14 @@ versioncheck:
 		-name '*.[hcS]' -type f -print | sort \
 		| xargs $(PERL) -w $(srctree)/scripts/checkversion.pl
 
+coccicheck-context coccicheck-patch coccicheck-org coccicheck-report:
+	@echo "\nPlease, check for false positive in the output before submitting a patch.\n\n"\
+		"Take particularly attention when using the \"patch\" mode\n"\
+		"and carefully review the patch YOU are about to submit.\n"
+	@find $(srctree)/scripts/smpl/                        \
+		-name '*.cocci' -type f                       \
+		-exec $(srctree)/scripts/spatch.sh $(SPATCH) $(@:coccicheck-%=%) \{} $(srctree) \;
+
 namespacecheck:
 	$(PERL) $(srctree)/scripts/namespace.pl
 
diff --git a/scripts/spatch.sh b/scripts/spatch.sh
new file mode 100755
index 0000000..bdcca15
--- /dev/null
+++ b/scripts/spatch.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+SPATCH="$1"
+MODE="$2"
+COCCI="$3"
+DIR="$4"
+
+OPT=`grep "Option" $COCCI | cut -d':' -f2`
+FILE=`echo $COCCI | sed "s|$DIR/||"`
+
+echo Processing `basename $COCCI` with \"$OPT\"
+echo Message example to submit a patch:
+grep "^///" $COCCI | sed "s|///||" | sed "s|THISFILE|$FILE|"
+$SPATCH -D $MODE -very_quiet -sp_file $COCCI $OPT -dir $DIR
-- 
1.6.3.3

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