From: Denis Efremov <efremov@linux.com>
To: julia.lawall@inria.fr
Cc: cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org
Subject: [Cocci] [PATCH] coccinelle: api: kfree_sensitive: print memset position
Date: Fri, 9 Oct 2020 15:54:53 +0300 [thread overview]
Message-ID: <20201009125453.31217-1-efremov@linux.com> (raw)
Print memset() call position in addition to the kfree() position to
ease issues identification.
Signed-off-by: Denis Efremov <efremov@linux.com>
---
scripts/coccinelle/api/kfree_sensitive.cocci | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/scripts/coccinelle/api/kfree_sensitive.cocci b/scripts/coccinelle/api/kfree_sensitive.cocci
index e4a066a0b77d..8d980ebf3223 100644
--- a/scripts/coccinelle/api/kfree_sensitive.cocci
+++ b/scripts/coccinelle/api/kfree_sensitive.cocci
@@ -85,14 +85,16 @@ type T;
@script:python depends on report@
p << r.p;
+m << r.m;
@@
-coccilib.report.print_report(p[0],
- "WARNING: opportunity for kfree_sensitive/kvfree_sensitive")
+msg = "WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line %s)"
+coccilib.report.print_report(p[0], msg % (m[0].line))
@script:python depends on org@
p << r.p;
+m << r.m;
@@
-coccilib.org.print_todo(p[0],
- "WARNING: opportunity for kfree_sensitive/kvfree_sensitive")
+msg = "WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line %s)"
+coccilib.org.print_todo(p[0], msg % (m[0].line))
--
2.26.2
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
WARNING: multiple messages have this Message-ID (diff)
From: Denis Efremov <efremov@linux.com>
To: julia.lawall@inria.fr
Cc: Denis Efremov <efremov@linux.com>,
cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org
Subject: [PATCH] coccinelle: api: kfree_sensitive: print memset position
Date: Fri, 9 Oct 2020 15:54:53 +0300 [thread overview]
Message-ID: <20201009125453.31217-1-efremov@linux.com> (raw)
Print memset() call position in addition to the kfree() position to
ease issues identification.
Signed-off-by: Denis Efremov <efremov@linux.com>
---
scripts/coccinelle/api/kfree_sensitive.cocci | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/scripts/coccinelle/api/kfree_sensitive.cocci b/scripts/coccinelle/api/kfree_sensitive.cocci
index e4a066a0b77d..8d980ebf3223 100644
--- a/scripts/coccinelle/api/kfree_sensitive.cocci
+++ b/scripts/coccinelle/api/kfree_sensitive.cocci
@@ -85,14 +85,16 @@ type T;
@script:python depends on report@
p << r.p;
+m << r.m;
@@
-coccilib.report.print_report(p[0],
- "WARNING: opportunity for kfree_sensitive/kvfree_sensitive")
+msg = "WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line %s)"
+coccilib.report.print_report(p[0], msg % (m[0].line))
@script:python depends on org@
p << r.p;
+m << r.m;
@@
-coccilib.org.print_todo(p[0],
- "WARNING: opportunity for kfree_sensitive/kvfree_sensitive")
+msg = "WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line %s)"
+coccilib.org.print_todo(p[0], msg % (m[0].line))
--
2.26.2
next reply other threads:[~2020-10-09 12:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 12:54 Denis Efremov [this message]
2020-10-09 12:54 ` [PATCH] coccinelle: api: kfree_sensitive: print memset position Denis Efremov
2020-10-10 19:27 ` [Cocci] " Julia Lawall
2020-10-10 19:27 ` Julia Lawall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201009125453.31217-1-efremov@linux.com \
--to=efremov@linux.com \
--cc=cocci@systeme.lip6.fr \
--cc=julia.lawall@inria.fr \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.