Re: [Cocci] [PATCH v2] coccinelle: api: add kzfree script

2020-06-06 Thread Julia Lawall
On Fri, 5 Jun 2020, Denis Efremov wrote: > It looks like a good idea to add type cast, like: > > +// Ignore kzfree definition > +// Ignore kasan test > +@r depends on !patch && !(file in "lib/test_kasan.c") && !(file in > "mm/slab_common.c") forall@ > +expression *E; > +position p; > +type T;

Re: [Cocci] [PATCH v2] coccinelle: api: add kzfree script

2020-06-04 Thread Denis Efremov
It looks like a good idea to add type cast, like: +// Ignore kzfree definition +// Ignore kasan test +@r depends on !patch && !(file in "lib/test_kasan.c") && !(file in "mm/slab_common.c") forall@ +expression *E; +position p; +type T; +@@ + +* \(memset\|memset_explicit\)((T)E, 0, ...); + ...

Re: [Cocci] [PATCH v2] coccinelle: api: add kzfree script

2020-06-04 Thread Denis Efremov
On 6/4/20 11:57 PM, Julia Lawall wrote: > On the other hand, do you really require E to be a pointer? If you do > that, it will have to find the type of E. If E refers to a structure > field, then the type might not be available in the current function, and > you may need command line argments

Re: [Cocci] [PATCH v2] coccinelle: api: add kzfree script

2020-06-04 Thread Julia Lawall
On Thu, 4 Jun 2020, Denis Efremov wrote: > Check for memset()/memset_explicit() with 0 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