All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: "Reshetova, Elena" <elena.reshetova@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cocci@systeme.lip6.fr" <cocci@systeme.lip6.fr>,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	"nicolas.palix@imag.fr" <nicolas.palix@imag.fr>,
	"mmarek@suse.com" <mmarek@suse.com>,
	"keescook@chromium.org" <keescook@chromium.org>,
	"ishkamiel@gmail.com" <ishkamiel@gmail.com>
Subject: RE: [PATCH] Coccinelle report script for refcounters
Date: Tue, 18 Jul 2017 13:53:10 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1707181352270.3408@hadrien> (raw)
In-Reply-To: <2236FBA76BA1254E88B949DDB74E612B6FF26A28@IRSMSX102.ger.corp.intel.com>



On Tue, 18 Jul 2017, Reshetova, Elena wrote:

> > On Tue, 18 Jul 2017, Elena Reshetova wrote:
> >
> > > The below script can be used to detect potential misusage
> > > of atomic_t type and API for reference counting purposes.
> > > Now when we have a dedicated refcount_t type and API with
> > > security protection implemented, people should be using it
> > > instead.
> > >
> > > Currently it still reports many occurences since we are
> > > nowhere near the end of our kernel-wide conversion execrise,
> > > but hopefully after couple of cycles more, the amount of
> > > output would be much more limited.
> > >
> > > Each script result must be analysed manually before any
> > > conversion, since refcount_t might not suit for certain
> > > purposes (for example if an object is not always destroyed
> > > upon refcounter reaching zero, if increments from zero are
> > > allowed in the code etc.)
> > >
> > > As we go further and get less results in output, we will
> > > improve the pattern to detect conversion cases more precisely.
> >
> > The regexps are the best you can do?
>
> They are simple and so far they were sufficient for the purpose since
> they found pretty much all the cases we are aware about. I was thinking
> on working to improve the pattern later on after we merge the bulk of
> conversions and I have some cycles free on that front.
>
> What would you suggest to do instead of regexps?

Is there anything about the definitions of these functions that indicates
why they are important?

julia

>
> Best Regards,
> Elena.
>
> >
> > julia
> >
> > >
> > > Elena Reshetova (1):
> > >   Coccinelle: add atomic_as_refcounter script
> > >
> > >  scripts/coccinelle/api/atomic_as_refcounter.cocci | 102
> > ++++++++++++++++++++++
> > >  1 file changed, 102 insertions(+)
> > >  create mode 100644 scripts/coccinelle/api/atomic_as_refcounter.cocci
> > >
> > > --
> > > 2.7.4
> > >
> > >
>

WARNING: multiple messages have this Message-ID (diff)
From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] [PATCH] Coccinelle report script for refcounters
Date: Tue, 18 Jul 2017 13:53:10 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1707181352270.3408@hadrien> (raw)
In-Reply-To: <2236FBA76BA1254E88B949DDB74E612B6FF26A28@IRSMSX102.ger.corp.intel.com>



On Tue, 18 Jul 2017, Reshetova, Elena wrote:

> > On Tue, 18 Jul 2017, Elena Reshetova wrote:
> >
> > > The below script can be used to detect potential misusage
> > > of atomic_t type and API for reference counting purposes.
> > > Now when we have a dedicated refcount_t type and API with
> > > security protection implemented, people should be using it
> > > instead.
> > >
> > > Currently it still reports many occurences since we are
> > > nowhere near the end of our kernel-wide conversion execrise,
> > > but hopefully after couple of cycles more, the amount of
> > > output would be much more limited.
> > >
> > > Each script result must be analysed manually before any
> > > conversion, since refcount_t might not suit for certain
> > > purposes (for example if an object is not always destroyed
> > > upon refcounter reaching zero, if increments from zero are
> > > allowed in the code etc.)
> > >
> > > As we go further and get less results in output, we will
> > > improve the pattern to detect conversion cases more precisely.
> >
> > The regexps are the best you can do?
>
> They are simple and so far they were sufficient for the purpose since
> they found pretty much all the cases we are aware about. I was thinking
> on working to improve the pattern later on after we merge the bulk of
> conversions and I have some cycles free on that front.
>
> What would you suggest to do instead of regexps?

Is there anything about the definitions of these functions that indicates
why they are important?

julia

>
> Best Regards,
> Elena.
>
> >
> > julia
> >
> > >
> > > Elena Reshetova (1):
> > >   Coccinelle: add atomic_as_refcounter script
> > >
> > >  scripts/coccinelle/api/atomic_as_refcounter.cocci | 102
> > ++++++++++++++++++++++
> > >  1 file changed, 102 insertions(+)
> > >  create mode 100644 scripts/coccinelle/api/atomic_as_refcounter.cocci
> > >
> > > --
> > > 2.7.4
> > >
> > >
>

  reply	other threads:[~2017-07-18 11:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18  7:48 [PATCH] Coccinelle report script for refcounters Elena Reshetova
2017-07-18  7:48 ` [Cocci] " Elena Reshetova
2017-07-18  7:48 ` [PATCH] Coccinelle: add atomic_as_refcounter script Elena Reshetova
2017-07-18  7:48   ` [Cocci] " Elena Reshetova
2017-07-18 16:21   ` Kees Cook
2017-07-18 16:21     ` [Cocci] " Kees Cook
2017-07-19 10:54     ` Reshetova, Elena
2017-07-19 10:54       ` [Cocci] " Reshetova, Elena
2017-08-04 15:23   ` Julia Lawall
2017-08-04 15:23     ` [Cocci] " Julia Lawall
2017-08-07 11:06     ` Reshetova, Elena
2017-08-07 11:06       ` [Cocci] " Reshetova, Elena
2017-08-08 18:34       ` [Cocci] " SF Markus Elfring
2017-07-18  8:47 ` [PATCH] Coccinelle report script for refcounters Julia Lawall
2017-07-18  8:47   ` [Cocci] " Julia Lawall
2017-07-18  9:30   ` Reshetova, Elena
2017-07-18  9:30     ` [Cocci] " Reshetova, Elena
2017-07-18 11:53     ` Julia Lawall [this message]
2017-07-18 11:53       ` Julia Lawall
2017-07-18 12:27       ` Reshetova, Elena
2017-07-18 12:27         ` [Cocci] " Reshetova, Elena
2017-07-18 15:10         ` Julia Lawall
2017-07-18 15:10           ` [Cocci] " Julia Lawall

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=alpine.DEB.2.20.1707181352270.3408@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=Gilles.Muller@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=elena.reshetova@intel.com \
    --cc=ishkamiel@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    --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.