From: Markus Elfring <Markus.Elfring@web.de>
To: Denis Efremov <efremov@linux.com>,
Gilles Muller <Gilles.Muller@lip6.fr>,
Julia Lawall <Julia.Lawall@lip6.fr>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
Nicolas Palix <nicolas.palix@imag.fr>
Cc: kernel-janitors@vger.kernel.org,
Coccinelle <cocci@systeme.lip6.fr>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/4] coccinelle: api: extend memdup_user transformation with GFP_USER
Date: Mon, 8 Jun 2020 19:20:38 +0200 [thread overview]
Message-ID: <c3464cad-e567-9ef5-b4e3-a01e3b11120b@web.de> (raw)
> Match GFP_USER and optional __GFP_NOWARN allocations with
> memdup_user.cocci rule.
You suggest another interesting software extension.
…
> +++ b/scripts/coccinelle/api/memdup_user.cocci
> @@ -20,7 +20,9 @@ expression from,to,size;
> identifier l1,l2;
> @@
>
> -- to = \(kmalloc\|kzalloc\)(size,GFP_KERNEL);
> +- to = \(kmalloc\|kzalloc\)
> + (size,\(GFP_KERNEL\|GFP_USER\|
> + \(GFP_KERNEL\|GFP_USER\)|__GFP_NOWARN\));
> + to = memdup_user(from,size);
But I find the proposed change for such SmPL code inappropriate.
It was specified by the means of the semantic patch language
to replace an assignment statement for which a function call provides a value.
I would interpret your adjustment in the way that an expression list
should be preserved.
Were two minus characters forgotten for the first SmPL rule?
Further concerns should be taken into account for the SmPL rule “r”.
I would appreciate if the clarification will be continued also for
the topic “Safer source code analysis by "memdup_user.cocci"”?
https://github.com/coccinelle/coccinelle/issues/78
Regards,
Markus
next reply other threads:[~2020-06-08 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-08 17:20 Markus Elfring [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-09 14:16 Markus Elfring
2020-06-08 15:00 [PATCH v2 0/4] Update memdup_user.cocci Denis Efremov
2020-06-08 15:00 ` [PATCH v2 1/4] coccinelle: api: extend memdup_user transformation with GFP_USER Denis Efremov
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=c3464cad-e567-9ef5-b4e3-a01e3b11120b@web.de \
--to=markus.elfring@web.de \
--cc=Gilles.Muller@lip6.fr \
--cc=Julia.Lawall@lip6.fr \
--cc=cocci@systeme.lip6.fr \
--cc=efremov@linux.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=nicolas.palix@imag.fr \
--cc=yamada.masahiro@socionext.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®