summaryrefslogtreecommitdiff
path: root/scripts/coccinelle/free/kfree.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/coccinelle/free/kfree.cocci')
-rw-r--r--scripts/coccinelle/free/kfree.cocci27
1 files changed, 20 insertions, 7 deletions
diff --git a/scripts/coccinelle/free/kfree.cocci b/scripts/coccinelle/free/kfree.cocci
index 577b78056990..6338bbac2f7f 100644
--- a/scripts/coccinelle/free/kfree.cocci
+++ b/scripts/coccinelle/free/kfree.cocci
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
/// Find a use after free.
//# Values of variables may imply that some
//# execution paths are not possible, resulting in false positives.
@@ -5,10 +6,10 @@
//# SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument
///
// Confidence: Moderate
-// Copyright: (C) 2010-2012 Nicolas Palix. GPLv2.
-// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2.
-// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2.
-// URL: http://coccinelle.lip6.fr/
+// Copyright: (C) 2010-2012 Nicolas Palix.
+// Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6.
+// Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6.
+// URL: https://coccinelle.gitlabpages.inria.fr/website
// Comments:
// Options: --no-includes --include-headers
@@ -20,7 +21,11 @@ expression E;
position p1;
@@
-kfree@p1(E)
+(
+ kfree@p1(E)
+|
+ kfree_sensitive@p1(E)
+)
@print expression@
constant char [] c;
@@ -60,7 +65,11 @@ position ok;
@@
while (1) { ...
- kfree@ok(E)
+(
+ kfree@ok(E)
+|
+ kfree_sensitive@ok(E)
+)
... when != break;
when != goto l;
when forall
@@ -74,7 +83,11 @@ statement S;
position free.p1!=loop.ok,p2!={print.p,sz.p};
@@
-kfree@p1(E,...)
+(
+ kfree@p1(E,...)
+|
+ kfree_sensitive@p1(E,...)
+)
...
(
iter(...,subE,...) S // no use