All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>,
	Denis Efremov <efremov@linux.com>,
	Coccinelle <cocci@systeme.lip6.fr>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()
Date: Wed, 22 Jul 2020 07:50:49 +0200	[thread overview]
Message-ID: <0b326e2b-723c-3482-c0ef-5d6592a9c6cb@web.de> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2007211158310.2487@hadrien>

>>> +@depends on patch@
>>> +expression from,to,size;
>>> +identifier l1,l2;
>>> +@@
>>> +
>>> +-  to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\));
>>> ++  to = vmemdup_user(from,size);
>>
>> I propose to combine the desired adjustment with the previous SmPL rule
>> by using another disjunction.

How do you think about to check run time characteristics for
the following SmPL script sketches?

A)
@R1@
@@
// Change something

@R2@
@@
// Change another thing


B)
@Replacement_with_disjunction@
@@
(
// R1: Change something
|
// R2: Change another thing
)


>>> +@rv depends on !patch@
>>> +expression from,to,size;
>>> +position p;
>>> +statement S1,S2;
>>> +@@
>>> +
>>> +*  to = \(kvmalloc@p\|kvzalloc@p\)(size,\(GFP_KERNEL\|GFP_USER\));
>>> +   if (to==NULL || ...) S1
>>> +   if (copy_from_user(to, from, size) != 0)
>>> +   S2
>>
>> * Can it be helpful to omit the SmPL asterisk functionality from
>>   the operation modes “org” and “report”?
>>
>> * Should the operation mode “context” work without an extra position metavariable?
>
> This is fine as is in all three aspects.

Is every technique from the Coccinelle software required for
each operation mode in such data processing approaches?

Regards,
Markus

WARNING: multiple messages have this Message-ID (diff)
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>,
	Denis Efremov <efremov@linux.com>,
	Coccinelle <cocci@systeme.lip6.fr>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user()
Date: Wed, 22 Jul 2020 05:50:49 +0000	[thread overview]
Message-ID: <0b326e2b-723c-3482-c0ef-5d6592a9c6cb@web.de> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2007211158310.2487@hadrien>

>>> +@depends on patch@
>>> +expression from,to,size;
>>> +identifier l1,l2;
>>> +@@
>>> +
>>> +-  to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\));
>>> ++  to = vmemdup_user(from,size);
>>
>> I propose to combine the desired adjustment with the previous SmPL rule
>> by using another disjunction.

How do you think about to check run time characteristics for
the following SmPL script sketches?

A)
@R1@
@@
// Change something

@R2@
@@
// Change another thing


B)
@Replacement_with_disjunction@
@@
(
// R1: Change something
|
// R2: Change another thing
)


>>> +@rv depends on !patch@
>>> +expression from,to,size;
>>> +position p;
>>> +statement S1,S2;
>>> +@@
>>> +
>>> +*  to = \(kvmalloc@p\|kvzalloc@p\)(size,\(GFP_KERNEL\|GFP_USER\));
>>> +   if (to==NULL || ...) S1
>>> +   if (copy_from_user(to, from, size) != 0)
>>> +   S2
>>
>> * Can it be helpful to omit the SmPL asterisk functionality from
>>   the operation modes “org” and “report”?
>>
>> * Should the operation mode “context” work without an extra position metavariable?
>
> This is fine as is in all three aspects.

Is every technique from the Coccinelle software required for
each operation mode in such data processing approaches?

Regards,
Markus

  parent reply	other threads:[~2020-07-22  5:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  9:30 [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_user() Markus Elfring
2020-07-21  9:30 ` Markus Elfring
2020-07-21  9:58 ` Julia Lawall
2020-07-21  9:58   ` [Cocci] " Julia Lawall
2020-07-21  9:58   ` Julia Lawall
2020-07-21 11:01   ` [v3 " Markus Elfring
2020-07-21 11:01     ` Markus Elfring
2020-07-22  5:50   ` Markus Elfring [this message]
2020-07-22  5:50     ` [PATCH v3 " Markus Elfring
2020-07-22  6:02     ` Julia Lawall
2020-07-22  6:02       ` [Cocci] " Julia Lawall
2020-07-22  6:02       ` Julia Lawall
2020-07-22  6:09       ` [v3 " Markus Elfring
2020-07-22  6:09         ` Markus Elfring
2020-07-22  6:24         ` Julia Lawall
2020-07-22  6:24           ` [Cocci] " Julia Lawall
2020-07-22  6:24           ` Julia Lawall
2020-07-22  6:44           ` Markus Elfring
2020-07-22  6:44             ` Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-07-20 16:22 [PATCH v3 0/3] Update memdup_user.cocci Denis Efremov
2020-07-20 16:22 ` [PATCH v3 2/3] coccinelle: api: extend memdup_user rule with vmemdup_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=0b326e2b-723c-3482-c0ef-5d6592a9c6cb@web.de \
    --to=markus.elfring@web.de \
    --cc=Gilles.Muller@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=efremov@linux.com \
    --cc=julia.lawall@inria.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    /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.