On Wed, 2 Sep 2020, Denis Efremov wrote:
> Check for "!A || A && B" condition. It's equivalent to
> "!A || B" condition.
>
> Signed-off-by: Denis Efremov
> ---
> scripts/coccinelle/misc/excluded_middle.cocci | 40 +++
> 1 file changed, 40 insertions(+)
> create mode 100644 sc
On Thu, 3 Sep 2020, Joe Perches wrote:
> On Thu, 2020-09-03 at 17:14 +0200, Julia Lawall wrote:
> > On Wed, 2 Sep 2020, Joe Perches wrote:
> > > On Wed, 2020-09-02 at 22:46 +0200, Julia Lawall wrote:
> > > > On Wed, 2 Sep 2020, Joe Perches wrote:
> > >
On Thu, 3 Sep 2020, Joe Perches wrote:
> On Thu, 2020-09-03 at 17:14 +0200, Julia Lawall wrote:
> > On Wed, 2 Sep 2020, Joe Perches wrote:
> > > On Wed, 2020-09-02 at 22:46 +0200, Julia Lawall wrote:
> > > > On Wed, 2 Sep 2020, Joe Perches wrote:
> > >
On Wed, 2 Sep 2020, Joe Perches wrote:
> On Wed, 2020-09-02 at 22:46 +0200, Julia Lawall wrote:
> >
> > On Wed, 2 Sep 2020, Joe Perches wrote:
> >
> > > On Sun, 2020-08-30 at 20:41 +0200, Julia Lawall wrote:
> > > > On Sun, 30 Aug 2020, Joe Perches wr
On Wed, 2 Sep 2020, Joe Perches wrote:
> On Wed, 2020-09-02 at 22:46 +0200, Julia Lawall wrote:
> >
> > On Wed, 2 Sep 2020, Joe Perches wrote:
> >
> > > On Sun, 2020-08-30 at 20:41 +0200, Julia Lawall wrote:
> > > > On Sun, 30 Aug 2020, Joe Perches wr
On Wed, 2 Sep 2020, Joe Perches wrote:
> On Sun, 2020-08-30 at 20:41 +0200, Julia Lawall wrote:
> > On Sun, 30 Aug 2020, Joe Perches wrote:
> > > On Sun, 2020-08-30 at 17:46 +0200, Julia Lawall wrote:
> > > > Unfortunately this does not work when the declaration
On Wed, 2 Sep 2020, Denis Efremov wrote:
>
>
> On 9/2/20 3:32 PM, Julia Lawall wrote:
> > There is an isomorphism that you can disable: ptr_to_array
>
> Thanks!
>
> Anyway, even with ptr_to_array enabled equalizing cmd->dmap[0] and
> cmd->dmap[1] looks inc
On Wed, 2 Sep 2020, Denis Efremov wrote:
> Hi,
>
> I'm trying to write a pattern to match expression without side-effects,
> i.e expression E but not i++, --i, function call.
>
> While trying to write it I faced that this expression matches different
> array indices. Actually, it's quite unexpe
On Wed, 2 Sep 2020, Markus Elfring wrote:
> …
> > +++ b/scripts/coccinelle/free/ifnullfree.cocci
> > @@ -20,8 +20,14 @@ expression E;
> > - if (E != NULL)
> > (
> >kfree(E);
> > +|
> > + kvfree(E);
> > |
> >kfree_sensitive(E);
> > +|
> > + kvfree_sensitive(E, ...);
> > +|
> > + vfr
On Wed, 2 Sep 2020, Denis Efremov wrote:
> Extend the list of free functions with kvfree(), kvfree_sensitive(),
> vfree().
>
> Signed-off-by: Denis Efremov
Applied, thanks.
julia
> ---
> scripts/coccinelle/free/ifnullfree.cocci | 11 +--
> 1 file changed, 9 insertions(+), 2 deletio
On Tue, 1 Sep 2020, Denis Efremov wrote:
> uninitialized_var() macro was removed from the sources [1] and
> other warning-silencing tricks were deprecated [2]. The purpose of this
> cocci script is to prevent new occurrences of uninitialized_var()
> open-coded variants.
>
> [1] commit 63a0895d9
On Tue, 1 Sep 2020, Denis Efremov wrote:
> Commit 63a0895d960a ("compiler: Remove uninitialized_var() macro") and
> commit 4b19bec97c88 ("docs: deprecated.rst: Add uninitialized_var()")
> removed uninitialized_var() and deprecated it.
I'm not really sure to understand the above. How can somet
On Sun, 30 Aug 2020, Joe Perches wrote:
> On Sun, 2020-08-30 at 17:46 +0200, Julia Lawall wrote:
> > The following:
> >
> > @not_int_not_len exists@
> > type T != int;
> > identifier x != len;
> > position p;
> > identifier sysfs =~
[...]
> Thanks, I used the slightly different from your suggestion
> where sysfs is an identifier with function args and a
> semicolon after the transform type, (otherwise I get cocci errors).
> like this below:
>
> But it doesn't work (no renaming) when there is an
> initializer to the variable t
On Sun, 30 Aug 2020, Markus Elfring wrote:
> >> How do you think about to use the following transformation variant?
> >
> > This is uselessly expensive. It is already known that there is at least
> > one occurrence of x.
>
> Would we like to care if the affected identifier should be updated mo
On Sun, 30 Aug 2020, Markus Elfring wrote:
> > - T x@p;
> > + int len
> > <...
> > - x
> > + len
> > ...>
>
> How do you think about to use the following transformation variant?
This is uselessly expensive. It is already known that there is at least
one occurrence of x.
julia
>
> -T x@p
On Sun, 30 Aug 2020, Joe Perches wrote:
> On Sun, 2020-08-30 at 08:57 +0200, Julia Lawall wrote:
> >
> > On Sat, 29 Aug 2020, Joe Perches wrote:
> >
> > > Is it me not understanding cocci grammar again?
> >
> > The problem is the loop. You are tryin
On Sat, 29 Aug 2020, Joe Perches wrote:
> Is it me not understanding cocci grammar again?
The problem is the loop. You are trying to change something in the body
of a loop and the body of a for loop might not be executed. ... means
that the thing must be found on every execution path.
Do yo
On Sat, 29 Aug 2020, Denis Efremov wrote:
>
>
> On 8/29/20 10:48 PM, Julia Lawall wrote:
> >
> >
> > On Sat, 29 Aug 2020, Joe Perches wrote:
> >
> >> On Sat, 2020-08-29 at 21:36 +0200, Julia Lawall wrote:
> >>>
> >>> On Wed,
On Sat, 29 Aug 2020, Joe Perches wrote:
> On Sat, 2020-08-29 at 21:36 +0200, Julia Lawall wrote:
> >
> > On Wed, 12 Aug 2020, Denis Efremov wrote:
> >
> > > Commit 63a0895d960a ("compiler: Remove uninitialized_var() macro") and
> > >
On Wed, 12 Aug 2020, Denis Efremov wrote:
> Commit 63a0895d960a ("compiler: Remove uninitialized_var() macro") and
> commit 4b19bec97c88 ("docs: deprecated.rst: Add uninitialized_var()")
> removed uninitialized_var() and deprecated it.
>
> The purpose of this script is to prevent new occurrence
On Sat, 29 Aug 2020, Markus Elfring wrote:
> > Suggest flex_array_size() wrapper to compute the size of a
> > flexible array member in a structure. The macro additionally
> > checks for integer overflows.
>
> Can the following script variant for the semantic patch language help
> to clarify any
On Sat, 29 Aug 2020, Markus Elfring wrote:
> >> Will this information trigger further consequences for the clarification
> >> of the topic “[RFC PATCH] coccinelle: api: add flex_array_size.cocci
> >> script”?
> >> https://lore.kernel.org/cocci/20200828163134.496386-1-efre...@linux.com/
> >> htt
On Sat, 29 Aug 2020, Markus Elfring wrote:
> >> @replacement@
> >> identifier array, instance, size;
> >> type T;
> >> @@
> >> (
> >> -sizeof(T)
> >> |
> >> -sizeof(*instance->array)
> >> )
> >> *
> >> +flex_array_size(instance, array,
> >> instance->size
> >> + )
On Sat, 29 Aug 2020, Markus Elfring wrote:
> Hello,
>
> The following small script variant for the semantic patch language gets
> accepted
> according to the software combination “Coccinelle 1.0.8-00159-g730dbb03”.
>
> @replacement@
> identifier array, instance, size;
> type T;
> @@
> (
> -size
On Sat, 29 Aug 2020, Markus Elfring wrote:
> > No, you can't compbine a type and an expression in a disjunction.
>
> Such an information can be reconsidered once more
> because the following script variant for the semantic patch language
> gets accepted by the Coccinelle software.
>
> @display@
On Fri, 28 Aug 2020, Markus Elfring wrote:
> Hello,
>
> I have tried another tiny script variant out for the semantic patch language
> (according to the software combination “Coccinelle 1.0.8-00159-g730dbb03”).
>
> @display@
> identifier array, instance;
> type T;
> @@
> *sizeof( \( T \| *(insta
On Fri, 28 Aug 2020, Denis Efremov wrote:
> Hi all,
>
> On 8/27/20 10:42 PM, Julia Lawall wrote:
> >
> >
> > On Thu, 27 Aug 2020, Joe Perches wrote:
> >
> >> On Thu, 2020-08-27 at 15:48 +0100, Alex Dewar wrote:
> >>> On Thu, Aug 27, 2020
On Thu, 27 Aug 2020, Joe Perches wrote:
> On Thu, 2020-08-27 at 21:42 +0200, Julia Lawall wrote:
> >
> > On Thu, 27 Aug 2020, Joe Perches wrote:
> >
> > > On Thu, 2020-08-27 at 15:48 +0100, Alex Dewar wrote:
> > > > On Thu, Aug 27, 2020 at 03:41:06PM +
On Thu, 27 Aug 2020, Joe Perches wrote:
> On Thu, 2020-08-27 at 15:48 +0100, Alex Dewar wrote:
> > On Thu, Aug 27, 2020 at 03:41:06PM +0200, Rasmus Villemoes wrote:
> > > On 27/08/2020 15.18, Alex Dewar wrote:
> > > > On Thu, Aug 27, 2020 at 09:15:37AM +0200, Greg Kroah-Hartman wrote:
> > > > >
On Fri, 21 Aug 2020, Joe Perches wrote:
> On Fri, 2020-08-21 at 23:35 -0400, Valdis Klētnieks wrote:
> > On Fri, 21 Aug 2020 18:08:08 -0700, Joe Perches said:
> > > (forwarding on to kernel-janitors/mentees and kernelnewbies)
> > >
> > > Just fyi for anyone that cares:
> > >
> > > A janitorial t
On Fri, 21 Aug 2020, Denis Efremov wrote:
> Use kobj_to_dev() instead of container_of().
>
> Signed-off-by: Denis Efremov
Applied, thanks.
julia
> ---
> Changes in v2:
> - "symbol kobj;" added to the rule r
>
> scripts/coccinelle/api/kobj_to_dev.cocci | 45
> 1 fi
On Fri, 21 Aug 2020, Denis Efremov wrote:
> Use kobj_to_dev() instead of container_of().
Thanks for the patch and the example commits.
Could you add
symbol kobj;
to the first rule? That's enough to get rid of the question about whether
kobj should be a metavariable in all cases.
thanks,
j
On Fri, 21 Aug 2020, Alex Dewar wrote:
> Commit dfd32cad146e ("dma-mapping: remove dma_zalloc_coherent()")
> removed the definition of dma_zalloc_coherent() and also removed the
> corresponding patch rule for replacing instances of dma_alloc_coherent +
> memset in zalloc-simple.cocci (though le
On Wed, 19 Aug 2020, Joe Perches wrote:
> On Wed, 2020-08-19 at 14:22 -0700, Joe Perches wrote:
> > There are commas used as statement terminations that should typically
> > have used semicolons instead. Only direct assignments or use of a single
> > function or value on a single line are dete
On Mon, 17 Aug 2020, Markus Elfring wrote:
> > What clarifications?
>
> Did you notice that my suggestion for the SmPL script variant
> “scripts/coccinelle/api/device_attr_show.cocci”
> can generate a patch?
> https://lore.kernel.org/cocci/0a9015b6-9037-59c5-31f2-cd2b32c86...@linux.com/
>
> Unf
On Mon, 17 Aug 2020, Markus Elfring wrote:
> >> Can missing source code matches trigger the consequence that questionable
> >> branches would be applied there?
> >
> > No.
>
> I imagine that corresponding views will need further clarifications.
What clarifications? In the failing_andany exampl
On Mon, 17 Aug 2020, Markus Elfring wrote:
> > The problem has nothing to do with disjunctions.
>
> Can missing source code matches trigger the consequence that questionable
> branches would be applied there?
No. The problem causes transformations that should be applied not to be
applied.
jul
On Mon, 17 Aug 2020, Markus Elfring wrote:
> > I will see if it can be fixed.
>
> How will the issue “failing tests - TODO” evolve further?
> https://github.com/coccinelle/coccinelle/commit/f2d7ec9006c89610bd1aab4662fcf100e3e6d469#diff-13ff769079511ec7b5dddef7143b2b93R1
failing_andany.cocci is
On Sun, 16 Aug 2020, Markus Elfring wrote:
> Can a source code search pattern like the following become ever usable?
>
> @display@
> @@
> *"%"
> ("d"
> |"ld"
> |"lld"
> )
> ("\n"
> |""
> )
>
>
> elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-cocci
> show_usage_of_selected_format_stri
> With this patch it generates nothing. I would expect spatch to generate
> a different patch with sprintf instead of scnprintf, because I think
> ... is enough to match "*(int *)(ea->var)". Even if it can't match sprintf
> pattern it should fallback to scnprintf pattern.
It's a known bug, explain
On Thu, 13 Aug 2020, Sumera Priyadarsini wrote:
>
>
> On Thu, 13 Aug, 2020, 1:45 AM Julia Lawall, wrote:
>
>
> On Wed, 12 Aug 2020, Sumera Priyadarsini wrote:
>
> > By default, coccicheck utilizes all available threads to implement
> &g
On Wed, 12 Aug 2020, Sumera Priyadarsini wrote:
> By default, coccicheck utilizes all available threads to implement
> parallelisation. However, when hyperthreading is enabled, this leads
> to all threads per core being occupied resulting in longer wall-clock
> times and higher power consumptio
On Wed, 12 Aug 2020, Markus Elfring wrote:
> > +@r@
> > +identifier var;
> > +type T;
> > +position p;
> > +@@
> > +
> > +(
> > +* T var@p = var;
> > +|
> > +* T var@p = *(&(var));
>
> I suggest to simplify such code for the semantic patch language a bit.
> Can an other variant be more succinct
On Tue, 11 Aug 2020, Sumera Priyadarsini wrote:
> Modify coccinelle documentation to further clarify
> the usage of the makefile C variable by coccicheck.
>
> Signed-off-by: Sumera Priyadarsini
Acked-by: Julia Lawall
Thanks.
>
> ---
> Changes in v4:
> -
On Mon, 10 Aug 2020, Markus Elfring wrote:
> > the usage of the makefile C variable flag by coccicheck.
>
> * Can it be confusing to denote an item as a variable and a flag?
>
> * Would you really like to stress here that a flag can be variable?
This is not part of the documentation, so it does
On Mon, 10 Aug 2020, Sumera Priyadarsini wrote:
> Modify coccinelle documentation to further clarify
> the usage of the makefile C variable flag by coccicheck.
>
> Signed-off-by: Sumera Priyadarsini
Thanks.
Acked-by: Julia Lawall
>
> ---
> Changes in v3:
>
On Mon, 10 Aug 2020, Jonathan Corbet wrote:
> On Mon, 10 Aug 2020 09:30:18 +0200
> Markus Elfring wrote:
>
> > > Modify coccinelle documentation to further clarify
> > > the usage of the makefile C variable flag by coccicheck.
> >
> > How do you think about a wording variant like the following
On Sun, 9 Aug 2020, Markus Elfring wrote:
> From: Markus Elfring
> Date: Sun, 9 Aug 2020 11:11:20 +0200
>
> Another patch rule was added. A bit of code was copied from a previous
> SmPL rule for this change specification.
>
> * Thus reduce duplicate code by using another SmPL disjunction.
I d
On Fri, 7 Aug 2020, Sumera Priyadarsini wrote:
> This patch modifies the coccinelle documentation to add further
> description for the usage of the C variable flags by coccicheck.
>
> Signed-off-by: Sumera Priyadarsini
> ---
> Documentation/dev-tools/coccinelle.rst | 5 -
> 1 file changed
On Wed, 5 Aug 2020, Sumera Priyadarsini wrote:
> This patch adds chain mode to the list of available modes in coccicheck.
Applied, Thanks!
julia
>
> Signed-off-by: Sumera Priyadarsini
> ---
> Changes in v2:
> - Change coccinelle to coccicheck as suggest
On Tue, 4 Aug 2020, Sumera Priyadarsini wrote:
> This patch adds chain mode to the list of available modes in coccinelle.
Thanks for the commit. In the log message, could you change "coccinelle"
o "coccicheck"? Actually, the modes are not something that are built into
Coccinelle. They are j
On Tue, 4 Aug 2020, Markus Elfring wrote:
> > Changes in v3:
> > - kvfree rules added
>
> I find it interesting to you found such an addition needed for this SmPL
> script.
> I imagine that it can be helpful to support such a source code search by
> a separate script for the semantic patch lan
On Mon, 3 Aug 2020, Markus Elfring wrote:
> …
> > +++ b/scripts/coccinelle/api/kvmalloc.cocci
> …
> > +@opportunity depends on !patch@
> > +expression E, E1, size;
> > +position p;
> > +@@
> > +
> > +(
> …
> > +|
> > +* E = \(kmalloc\|kzalloc\|kcalloc\|kmalloc_node\|kzalloc_node\|
> > +* k
On Mon, 3 Aug 2020, Denis Efremov wrote:
>
>
> On 8/2/20 11:24 PM, Julia Lawall wrote:
> >> +@initialize:python@
> >> +@@
> >> +# low-level memory api
> >> +filter = frozenset(['__vmalloc_area_node'])
> >> +
> >> +def re
On Mon, 3 Aug 2020, Denis Efremov wrote:
> Is there a difference from cocci point of view between:
>
> ... when != !is_vmalloc_addr(E)
This will only reject cases where the ! is present. Coccinelle doesn't
apply isomorphisms to the C source code, so it doesn't detect that eg
if (A)
B
else
On Mon, 3 Aug 2020, Markus Elfring wrote:
> >> Do you care if a SmPL name variable would accidentally not be used
> >> (like in the script
> >> “https://github.com/coccinelle/coccinelle/blob/04f36d537b9f6c0c127d05184cccd21f1a46b952/tests/metaattr.cocci#L2”)?
> >
> > It actually is used, to help
> +@initialize:python@
> +@@
> +# low-level memory api
> +filter = frozenset(['__vmalloc_area_node'])
> +
> +def relevant(p):
> +return not (filter & {el.current_element for el in p})
Is this used?
Otherwise, I think it would be good to not warn about a use of kvfree
if that use is reachable
On Sun, 2 Aug 2020, Markus Elfring wrote:
> >> How do you distinguish between metavariables and other SmPL variables then?
> >
> > Metavariables don't have "name" in their declaration. There is a sentence
> > about that in the documentation.
> >
> > The {\bf name} modifier specifies that instea
On Sun, 2 Aug 2020, Markus Elfring wrote:
> >>> attribute name __attr__; declares that __attr__ is the name of an
> >>> attribute.
> >>
> >> Is this specification also a declaration of a metavariable?
> >
> > No.
>
> How do you distinguish between metavariables and other SmPL variables then?
M
On Sun, 2 Aug 2020, Markus Elfring wrote:
> >> How do you call the following items in the update step “[PATCH 42/43]
> >> tests:
> >> Add test case to match meta attribute”?
> >> https://lore.kernel.org/cocci/25fb4894-65d3-dc57-dbfd-93d3482d8...@web.de/
> >> https://systeme.lip6.fr/pipermail/co
On Sun, 2 Aug 2020, Markus Elfring wrote:
> >> Will the Coccinelle software itself present a warning like “metavariable
> >> __attr__
> >> not used in the - or context code”?
> >
> > No. It's not a metavariable.
>
> How do you call the following items in the update step “[PATCH 42/43] tests:
>
On Sun, 2 Aug 2020, Markus Elfring wrote:
> >> Would you like to integrate corresponding patches for known open issues
> >> (a bit later) then?
> >
> > No, the code is fine.
>
> Will the Coccinelle software itself present a warning like “metavariable
> __attr__
> not used in the - or context co
On Sun, 2 Aug 2020, Markus Elfring wrote:
> >>> Applied.
> >>
> >> Does this information indicate that you do not care for specific
> >> patch review concerns according to these test cases at the moment?
> >
> > Yes, that's what it means.
>
> Would you like to integrate corresponding patches fo
On Sun, 2 Aug 2020, Markus Elfring wrote:
> …
> > +++ b/scripts/coccinelle/api/kvfree.cocci
> …
> > +@choice@
> > +expression E, E1;
> > +position kok, vok;
> > +@@
> > +
> > +(
> …
> > +|
> > + E = \(kmalloc\|kzalloc\|krealloc\|kcalloc\|kmalloc_node\|kzalloc_node\|
> > +kmalloc_array\|
On Sun, 2 Aug 2020, Markus Elfring wrote:
> > > Two test cases are included for detecting and removing meta attributes.
> >
> > Applied.
>
> Does this information indicate that you do not care for specific
> patch review concerns according to these test cases at the moment?
Yes, that's what it
On Sun, 26 Jul 2020, Jaskaran Singh wrote:
> This patch series aims to add support for meta attributes in SmPL.
> Currently, only meta attributes in context and minus code are supported.
>
> Changes include adding the MetaAttribute and MetaAttributeDecl constructors to
> the SmPL ASTs and the M
On Fri, 31 Jul 2020, Denis Efremov wrote:
> Hi,
>
> This pattern:
> - E = kzalloc(size, flags | __GFP_NOWARN);
> - if (\(!E\|E == null\))@p
> - E = vzalloc(size);
> + E = kvzalloc(size, flags);
>
> matches this code:
> void *p;
> p = kzalloc(size, gfp | __GFP_NOWARN);
>
> if (!p)
> p =
On Fri, 31 Jul 2020, Markus Elfring wrote:
> > +msg = "WARNING: kmalloc is used to allocate this memory at line %s" %
> > (k[0].line)
> > +coccilib.org.print_todo(p[0], msg)
>
> * I find the diagnostic text insufficient.
> >>>
> >>> I also find the message not very inform
> >
> > Do the checks for the opportunities for kvmalloc really belong in this
> > rule? That issue is not mentioned in the commit log or the description of
> > the semantic patch.
>
> I added this at the last moment. It was easy enough to add it based on
> existing
> patterns. I will add descrip
On Fri, 31 Jul 2020, Markus Elfring wrote:
> >>> +msg = "WARNING: kmalloc is used to allocate this memory at line %s" %
> >>> (k[0].line)
> >>> +coccilib.org.print_todo(p[0], msg)
> >>
> >> * I find the diagnostic text insufficient.
> >
> > I also find the message not very informative.
>
> Is i
On Thu, 30 Jul 2020, Denis Efremov wrote:
> Check that alloc and free types of functions match each other.
Do the checks for the opportunities for kvmalloc really belong in this
rule? That issue is not mentioned in the commit log or the description of
the semantic patch.
With the current pat
Actually, the message looks fine. Sorry for the noise about that.
However there is a problem in the kfree case:
> +@kfree depends on !patch@
> +expression E;
> +position v != choice.vok;
> +position p;
> +@@
> +
> +* E =
> \(vmalloc@v\|vzalloc@v\|vmalloc_user@v\|vmalloc_node@v\|vzalloc_node@v\|
> > +msg = "WARNING: kmalloc is used to allocate this memory at line %s" %
> > (k[0].line)
> > +coccilib.org.print_todo(p[0], msg)
>
> * I find the diagnostic text insufficient.
I also find the message not very informative.
All of the other comments are not useful, and some are simply incorrect.
On Mon, 20 Jul 2020, Denis Efremov wrote:
> Add GFP_USER to the allocation flags and handle vmemdup_user().
>
> Changes in v2:
> - memdup_user/vmemdup_user matching suppressed
> - PoC for selfcheck virtual rule
> Changes in v3:
> - add missing '-' for patch rule in kmalloc/kzalloc call args
On Wed, 22 Jul 2020, Markus Elfring wrote:
> > Markus, you are welcome to try this since you are concerned about it.
>
> I dare to point software design variations for some reasons.
>
>
> > But it doesn't matter.
>
> Under which circumstances would you begin to care more for involved
> differe
On Wed, 22 Jul 2020, Markus Elfring wrote:
> >>> +@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
On Tue, 21 Jul 2020, Markus Elfring wrote:
> …
> > +++ b/scripts/coccinelle/api/memdup_user.cocci
> > @@ -39,6 +39,28 @@ …
> …
> > +@depends on patch@
> > +expression from,to,size;
> > +identifier l1,l2;
> > +@@
> > +
> > +- to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\));
> > ++ to
On Thu, 16 Jul 2020, Jaskaran Singh wrote:
> This patch series aims to add a public function for visiting attributes
> to the SmPL AST visitor. This is needed to support meta attributes.
Applied. Thanks.
>
> Jaskaran Singh (17):
> parsing_cocci: visitor_ast: Add attributefn to SmPL AST
On Thu, 16 Jul 2020, Jaskaran Singh wrote:
> This patch series aims to add a public function for visiting attributes
> to the SmPL AST0 visitor. This is needed to support meta attributes. An
> AttributeTag constructor is also added due to dependencies, as well as
> to maintain consistency with
On Sat, 18 Jul 2020, Denis Efremov wrote:
> Hi,
>
> On 7/18/20 9:45 AM, Julia Lawall wrote:
> > This on is indeed a problem. I think it was not detected in testing,
> > because in the current kernel the rule never applies. But Denis, in
> >
>
On Sat, 18 Jul 2020, Markus Elfring wrote:
> >>> Applied.
> >>
> >> Do you care for patch review concerns according to this SmPL script
> >> adjustment?
> >>
> >> *
> >> https://lore.kernel.org/cocci/5c0dae88-e172-3ba6-f86c-d1a6238bb...@web.de/
> >> https://lkml.org/lkml/2020/6/9/568
> >
> >
On Sat, 18 Jul 2020, Markus Elfring wrote:
> > Applied.
>
> Do you care for patch review concerns according to this SmPL script
> adjustment?
>
> * https://lore.kernel.org/cocci/5c0dae88-e172-3ba6-f86c-d1a6238bb...@web.de/
> https://lkml.org/lkml/2020/6/9/568
This one it complete nonsense.
On Mon, 8 Jun 2020, Denis Efremov wrote:
> Match GFP_USER and optional __GFP_NOWARN allocations with
> memdup_user.cocci rule.
> Commit 6c2c97a24f09 ("memdup_user(): switch to GFP_USER") switched
> memdup_user() from GFP_KERNEL to GFP_USER. In almost all cases it
> is still a good idea to recom
On Fri, 17 Jul 2020, Denis Efremov wrote:
> Check for memset()/memzero_explicit() followed by kfree()/vfree()/kvfree().
>
> Signed-off-by: Denis Efremov
Applied.
> ---
> Changes in v2:
> - memset_explicit() added
> - kvfree_sensitive() added
> - forall added to r1
> - ... between memset
On Sat, 11 Jul 2020, Jaskaran Singh wrote:
> Add more tokens (binary operators and colon) to the match ladder in
> is_permissible_proto. These cases would otherwise cause parsing errors
> for function calls after these tokens.
Thanks, but it doesn't apply:
Applying: parsing_cocci: parse_cocci
On Wed, 8 Jul 2020, Jaskaran Singh wrote:
> This patch series aims to wrap the existing attribute type on the SmPL
> side. Wrapping attributes is necessary to add support for meta
> attributes in SmPL.
Applied.
I would like to take the opportunity to thank Collabora for funding the
completio
On Mon, 15 Jun 2020, Denis Efremov wrote:
> Check for memset()/memzero_explicit() followed by kfree()/vfree()/kvfree().
>
> Signed-off-by: Denis Efremov
> ---
> Changes in v2:
> - memset_explicit() added
> - kvfree_sensitive() added
> - forall added to r1
> - ... between memset and kfree a
On Tue, 7 Jul 2020, Markus Elfring wrote:
> Hello,
>
> I have tried another tiny script variant out for the semantic patch language
> (according to the software combination “Coccinelle 1.0.8-00139-gd0fd4c7d”).
>
> @addition@
> identifier work;
> expression action;
> @@
> void work(...)
> {
>
On Fri, 3 Jul 2020, Jaskaran Singh wrote:
> Attributes are wrapped in the SmPL AST. Reciprocate this and wrap
> attributes in the SmPL parser.
This doesn't apply for me.
julia
>
> Signed-off-by: Jaskaran Singh
> ---
> parsing_cocci/parse_aux.ml| 3 +++
> parsing_cocci/parse_a
On Fri, 3 Jul 2020, Jaskaran Singh wrote:
> Attributes are wrapped in the SmPL AST. Reflect these changes in
> arity.ml.
This gives some space before tab errors.
julia
>
> Signed-off-by: Jaskaran Singh
> ---
> parsing_cocci/arity.ml | 67 +++---
> 1 file
On Thu, 2 Jul 2020, Matthew Wilcox wrote:
> On Wed, Jul 01, 2020 at 07:52:58AM -0700, Randy Dunlap wrote:
> > On 7/1/20 6:32 AM, Markus Elfring wrote:
> > >>> How do you think about to use the following command variant
> > >>> for the adjustment of the software documentation?
> > >>>
> > >>> +
On Wed, 1 Jul 2020, Randy Dunlap wrote:
> From: Randy Dunlap
>
> Fix various typos etc. in dev-tools/coccinelle.rst:
>
> - punctuation, grammar, wording
Acked-by: Julia Lawall
Thanks!
julia
>
> Signed-off-by: Randy Dunlap
> Cc: Julia Lawall
> Cc: Gilles
On Mon, 29 Jun 2020, Randy Dunlap wrote:
> From: Randy Dunlap
>
> Fix various typos etc. in dev-tools/coccinelle.rst:
>
> - punctuation, grammar, wording
> - add "path/to/file.c" when using Coccinelle to check a single file
>
> Signed-off-by: Randy Dunlap
> As Coccinelle features get added some more advanced SmPL patches
> may require newer versions of Coccinelle. If an SmPL patch requires
> -at least a version of Coccinelle, this can be specified as follows,
> +at minimum version of Coccinelle, this can be specified as follows,
at -> a
thanks,
On Fri, 26 Jun 2020, Markus Elfring wrote:
> I assumed that I may omit the semicolon in such a SmPL code.
> Can the specification of a SmPL nest construct ever be sufficient here?
> >>>
> >>> No. <+... ...+> matches a subtree of an AST. For a variable
> >>> initialization, there is
On Fri, 26 Jun 2020, Markus Elfring wrote:
> >> I assumed that I may omit the semicolon in such a SmPL code.
> >> Can the specification of a SmPL nest construct ever be sufficient here?
> >
> > No. <+... ...+> matches a subtree of an AST. For a variable
> > initialization, there is no subtree
On Fri, 26 Jun 2020, Markus Elfring wrote:
> >> <+... when any
> >> (t2 y = <+...
> >> ( sizeof(*(resource))
> >> |
> >> * *(resource)
> >> ) ...+>
> >
> > You are missing a ; here.
>
> I assumed that I may omit the semicolon in such a SmPL code.
> Can the specification of a
On Fri, 26 Jun 2020, Markus Elfring wrote:
> Hello,
>
> I have tried another small script variant out for the semantic patch language
> (according to the software combination “Coccinelle 1.0.8-00131-g675b9670”).
>
> @display@
> type t1, t2;
> expression action;
> identifier resource, y;
> statem
On Fri, 26 Jun 2020, Markus Elfring wrote:
> Hello,
>
> I have tried another tiny script variant out for the semantic patch language
> (according to the software combination “Coccinelle 1.0.8-00131-g675b9670”).
>
> @display@
> expression* x;
> statement is, es;
> @@
> *if (!x)
> is
> else
>
201 - 300 of 2726 matches
Mail list logo