qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, "Kevin Wolf" <kwolf@redhat.com>,
	qemu-block@nongnu.org, patches@linaro.org,
	"Max Reitz" <mreitz@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>
Subject: Re: [Qemu-devel] [PATCH] block/parallels.c: avoid integer overflow in allocate_clusters()
Date: Fri, 31 Mar 2017 17:18:39 +0100	[thread overview]
Message-ID: <20170331161839.GA18974@stefanha-x1.localdomain> (raw)
In-Reply-To: <20170331134033.GY3709@thinpad.lan.raisama.net>

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

On Fri, Mar 31, 2017 at 10:40:33AM -0300, Eduardo Habkost wrote:
> On Fri, Mar 31, 2017 at 10:27:44AM -0300, Philippe Mathieu-Daudé wrote:
> > Hi,
> > 
> > Eduardo you seem skilled regarding Coccinelle scripts, is it possible to
> > write one to find those overflows?
> 
> Probably not. AFAIK, Coccinelle rules are based on local code
> syntax only. This means it doesn't know the data type of
> expressions like (s->tracks).

I'm surprised by that statement.  Coccinelle isn't a text matcher, it's
a proper C compiler frontend that parses the all code in the compilation
unit.  Therefore it must have the type information even for s->tracks.

Disclaimer: This should in no way be considered a volunteer offer to
write cocci scripts now or at any time in the future :).  I'm not fluent
in the semantic patch syntax.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2017-03-31 16:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 13:13 [Qemu-devel] [PATCH] block/parallels.c: avoid integer overflow in allocate_clusters() Peter Maydell
2017-03-31 13:27 ` Philippe Mathieu-Daudé
2017-03-31 13:28   ` Peter Maydell
2017-03-31 13:40   ` Eduardo Habkost
2017-03-31 16:18     ` Stefan Hajnoczi [this message]
2017-03-31 17:10       ` Eduardo Habkost
2017-03-31 13:47 ` Max Reitz
2017-03-31 14:54   ` Denis V. Lunev
2017-03-31 14:56     ` Max Reitz
2017-03-31 15:00       ` Denis V. Lunev
2017-03-31 16:20   ` Stefan Hajnoczi
2017-03-31 16:41     ` Max Reitz

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=20170331161839.GA18974@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=den@openvz.org \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).