Re: [Cocci] [PATCH] coccinelle: misc: add array_size_dup script to detect missed overlow checks

2020-06-18 Thread Julia Lawall
On Thu, 18 Jun 2020, Kees Cook wrote: > On Thu, Jun 18, 2020 at 09:56:18PM +0200, Julia Lawall wrote: > > @@ > > identifier i,fld; > > expression e; > > @@ > > > > \(\(i\|e.fld\|e->fld\) \& E\) > > > > The e will match all of the variants you are concerned about. > > Ah, I see! Okay, that's

Re: [Cocci] [PATCH] coccinelle: misc: add array_size_dup script to detect missed overlow checks

2020-06-18 Thread Kees Cook
On Thu, Jun 18, 2020 at 09:56:18PM +0200, Julia Lawall wrote: > @@ > identifier i,fld; > expression e; > @@ > > \(\(i\|e.fld\|e->fld\) \& E\) > > The e will match all of the variants you are concerned about. Ah, I see! Okay, that's good. And the "& E" part is to effectively collect it into E

Re: [Cocci] Fwd: [~npalix/ubuntu/coccinelle/focal] coccinelle 1.0.8~20.04npalix1 (Accepted)

2020-06-18 Thread Julia Lawall
On Thu, 18 Jun 2020, NICOLAS PALIX wrote: > Hi, > > I released the 1.0.8 version ported to 20.04 focal > on the coccinelle PPA. Thanks! julia > > Regards, > >

[Cocci] Fwd: [~npalix/ubuntu/coccinelle/focal] coccinelle 1.0.8~20.04npalix1 (Accepted)

2020-06-18 Thread NICOLAS PALIX
Hi, I released the 1.0.8 version ported to 20.04 focal on the coccinelle PPA. Regards, De: "Launchpad PPA" À: "Nicolas Palix" Envoyé: Jeudi 18 Juin 2020 20:55:16 Objet: [~npalix/ubuntu/coccinelle/focal] coccinelle 1.0.8~20.04npalix1 (Accepted) Accepted: OK:

Re: [Cocci] [PATCH] coccinelle: misc: add array_size_dup script to detect missed overlow checks

2020-06-18 Thread Julia Lawall
On Thu, 18 Jun 2020, Kees Cook wrote: > On Wed, Jun 17, 2020 at 08:54:03PM +0200, Julia Lawall wrote: > > > > > > On Wed, 17 Jun 2020, Kees Cook wrote: > > > > > On Mon, Jun 15, 2020 at 01:20:45PM +0300, Denis Efremov wrote: > > > > +@as@ > > > > +expression E1, E2; > > > > +@@ > > > > + > > >

Re: [Cocci] [PATCH] coccinelle: misc: add array_size_dup script to detect missed overlow checks

2020-06-18 Thread Kees Cook
On Wed, Jun 17, 2020 at 08:54:03PM +0200, Julia Lawall wrote: > > > On Wed, 17 Jun 2020, Kees Cook wrote: > > > On Mon, Jun 15, 2020 at 01:20:45PM +0300, Denis Efremov wrote: > > > +@as@ > > > +expression E1, E2; > > > +@@ > > > + > > > +array_size(E1, E2) > > > > BTW, is there a way yet in

Re: [Cocci] moving variable declarations up

2020-06-18 Thread Julia Lawall
On Wed, 17 Jun 2020, Johannes Berg wrote: > On Wed, 2020-06-17 at 23:19 +0200, Johannes Berg wrote: > > On Wed, 2020-06-17 at 23:15 +0200, Julia Lawall wrote: > > > > +T x; > > > > > > Change the + to ++ > > Heh, something funny happened > > + u16 *foo; > + u16[2] bar; > > ... some code ... >

Re: [Cocci] moving variable declarations up

2020-06-18 Thread Julia Lawall
On Wed, 17 Jun 2020, Johannes Berg wrote: > On Wed, 2020-06-17 at 23:19 +0200, Johannes Berg wrote: > > On Wed, 2020-06-17 at 23:15 +0200, Julia Lawall wrote: > > > > +T x; > > > > > > Change the + to ++ > > Heh, something funny happened > > + u16 *foo; > + u16[2] bar; > > ... some code ... >

Re: [Cocci] [PATCH v2] coccinelle: misc: add array_size_dup script to detect missed overflow checks

2020-06-18 Thread Denis Efremov
Hi, On 6/18/20 2:34 PM, Markus Elfring wrote: > Why did you repeat a typo from the previous patch subject? Where is the typo? I can't handle your suggestions because your mails constantly break the threads. I just can't find them after due to missed/wrong In-Reply-To headers. Again, this mail

[Cocci] [PATCH v2] coccinelle: misc: add array_size_dup script to detect missed overlow checks

2020-06-18 Thread Denis Efremov
Detect an opencoded expression that is used before or after array_size()/array3_size()/struct_size() to compute the same size. Cc: Gustavo A. R. Silva Cc: Kees Cook Signed-off-by: Denis Efremov --- Changes in v2: - python rules moved next to SmPL patterns - assignment operator used -

Re: [Cocci] moving variable declarations up

2020-06-18 Thread Johannes Berg
On Thu, 2020-06-18 at 07:59 +0200, Julia Lawall wrote: > > What's the difference between "..." and "... when any"? > > A ... B connects an A to the closest B, as you might like in some code > with lots of locks and unlocks. When any picks up any subsequent B, even > if there is another B

Re: [Cocci] moving variable declarations up

2020-06-18 Thread Johannes Berg
On Thu, 2020-06-18 at 09:33 +0200, Markus Elfring wrote: > > > You tried it out to move the variable “bar” which is an array of two > > > pointers. > > > > Oops. I just mistyped that when transcribing it to email... It was 'u16 > > bar[2];' in the original. > > The intended absence of asterisks

Re: [Cocci] moving variable declarations up

2020-06-18 Thread Johannes Berg
On Thu, 2020-06-18 at 09:19 +0200, Markus Elfring wrote: > > > > > +T x; > > > > > > > > Change the + to ++ > > > > Heh, something funny happened > > > > + u16 *foo; > > + u16[2] bar; > > > > ... some code ... > > > > -u16 *foo; > > -u16 *bar[2]; > > > > > > What happened to the array

Re: [Cocci] moving variable declarations up

2020-06-18 Thread Julia Lawall
On Wed, 17 Jun 2020, Johannes Berg wrote: > On Wed, 2020-06-17 at 23:15 +0200, Julia Lawall wrote: > > > > > +T x; > > > > Change the + to ++ > > Hah, I think you mentioned that to me before, but I can never remember > what it does ... > > > There is no guarantee on the order in which the