mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Denis Efremov <efremov@linux.com>,
	"Gustavo A. R. Silva" <garsilva@embeddedor.com>,
	Kees Cook <keescook@chromium.org>,
	Coccinelle <cocci@systeme.lip6.fr>
Cc: linux-kernel@vger.kernel.org, Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH] coccinelle: misc: Add array_size_dup script to detect missed overflow checks
Date: Wed, 17 Jun 2020 16:36:07 +0200	[thread overview]
Message-ID: <0a3ae217-c58d-79d6-a164-20ef6392ebeb@web.de> (raw)

I propose once more to avoid a typo in the previous patch subject.


…
> (
> - size = E1 * E2;
> + size = array_size(E1, E2);
> |
> - size = E1 * E2 * E3;
> + size = array3_size(E1, E2, E3);
> |
> - size = E1 * E2 + E3;
> + size = struct_size(E1, E2, E3);
> )

How do you think about to use SmPL disjunctions like the following?

 size =
(
-       (E1) * (E2)
+       array_size(E1, E2)
|
-       (E1) * (E2) * (E3)
+       array3_size(E1, E2, E3)
|
-       (E1) * (E2) + (E3)
+       struct_size(E1, E2, E3)
);


>   ... when != size = E4
>       when != size += E4
…

Can it become helpful to express a constraint for a metavariable of
the type “assignment operator”?


> (
> * size = E1 * E2;@p
> |
> * size = E1 * E2 * E3;@p
> |
> * size = E1 * E2 + E3;@p
> )

*size =@p \( (E1) * (E2) \| (E1) * (E2) * (E3) \| (E1) * (E2) + (E3) \)

Regards,
Markus

             reply	other threads:[~2020-06-17 14:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 14:36 Markus Elfring [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-17 16:14 [PATCH] coccinelle: misc: add " Markus Elfring
2020-06-15 12:25 Markus Elfring

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=0a3ae217-c58d-79d6-a164-20ef6392ebeb@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    --cc=efremov@linux.com \
    --cc=garsilva@embeddedor.com \
    --cc=julia.lawall@lip6.fr \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®