Smatch (Semantic Matching Tool) development
 help / color / mirror / Atom feed
From: Norbert Manthey <nmanthey@amazon.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Norbert Manthey <norbertmanthey@googlemail.com>,
	smatch@vger.kernel.org, jsteckli@amazon.com,
	tautschn@amazon.co.uk
Subject: Re: Smatch for Xen
Date: Tue, 14 Aug 2018 16:33:15 +0200	[thread overview]
Message-ID: <e7222a62-8a49-717f-0589-25d1f304e036@amazon.de> (raw)
In-Reply-To: <20180814142117.v7tavkwisxcoel2f@mwanda>

Oh, that's nice. I'll play with the new script.

Concerning the copy from user functions, I have a few patches locally to
get the functions into the tool, which I just have to make a little
nicer before sharing. I will post them once done. I found the
"copy_from_guest" string also at other places, as well as matching
syscalls which come with a user controllable argument. The patches
should cover all those.

Concerning the project name, I'd love to enable all of the kernel
analysis for Xen as well, as allocation, locking, taint and all the
others are similarly important for both projects. I spotted a few places
where the Kernel project name is treated specially (or more extensively
than generic projects), so it felt most simple to just call the project
kernel as well.

Is the parsing performed by smatch, or by sparse? Eventually it's good
enough to add a "-D __GNUC__=5" to the command line to pretend being a
recent compiler? The compile.h file seems to care about version 4 only,
AFAICT.

Best,
Norbert

On 08/14/2018 04:21 PM, Dan Carpenter wrote:
> On Tue, Aug 14, 2018 at 03:27:43PM +0200, Norbert Manthey wrote:
>> Thanks a lot! I used your scripts and compiled Xen now, as well as
>> created the data base for it. As I am interested in analysis that is run
>> for the kernel, I also asked the tool to name the project "kernel", as
>> that enabled this analysis (e.g. the spectre analysis).
>>
>> I called the build_xen_data.sh scripts multiple times on an upstream Xen
>> release branch, and the number of warnings did not increase, while for
>> the Linux kernel the number of warnings would increase, e.g. warnings
>> that depend on the taint analysis like the spectre analysis. Is that
>> expected, and is there a way to improve that for Xen?
>>
> 
> Yeah.  I just noticed that as well.  I've added the --db-file= option.
> See the new attached build scripts.
> 
> I'm going to make xen it's own project for the purposes of
> check_user_data2.c.  Which functions should set the data as tainted?
> Like copy_from_user() in the kernel.  Is it really just the same
> functions?
> 
> I wish I could figure out which version of GCC smatch is saying it is so
> I could sort out why the build fails.  It's parsing compiler.h wrong.
> 
> regards,
> dan carpenter
> 
> 
Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B

  reply	other threads:[~2018-08-14 17:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30 12:40 Smatch for Xen Norbert Manthey
2018-07-30 16:34 ` [PATCH 0/3] add support for mode __pointer__ & __byte__ Luc Van Oostenryck
2018-07-30 16:34   ` [PATCH 1/3] mode keywords don't need MOD_{CHAR,LONG,...} Luc Van Oostenryck
2018-07-30 16:34   ` [PATCH 2/3] add support for mode __pointer__ Luc Van Oostenryck
2018-07-30 16:34   ` [PATCH 3/3] add support for mode __byte__ Luc Van Oostenryck
2018-08-06 10:31 ` Smatch for Xen Dan Carpenter
2018-08-06 11:20   ` Dan Carpenter
2018-08-06 13:16     ` Dan Carpenter
     [not found]       ` <CAByO1we3OABkX8XCwh7Vq8iHyXAuFtJ3t+Ta3DVCLe9pP6K8ew@mail.gmail.com>
2018-08-06 13:54         ` Dan Carpenter
2018-08-13 14:25           ` Norbert Manthey
2018-08-13 17:58             ` Dan Carpenter
2018-08-13 18:31               ` Dan Carpenter
2018-08-14 13:27                 ` Norbert Manthey
2018-08-14 14:21                   ` Dan Carpenter
2018-08-14 14:33                     ` Norbert Manthey [this message]
2018-08-14 14:52                       ` Dan Carpenter
2018-08-14 15:05                         ` Norbert Manthey
2018-08-15  9:03                       ` Dan Carpenter
2018-08-15 13:44                         ` Norbert Manthey

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=e7222a62-8a49-717f-0589-25d1f304e036@amazon.de \
    --to=nmanthey@amazon.de \
    --cc=dan.carpenter@oracle.com \
    --cc=jsteckli@amazon.com \
    --cc=norbertmanthey@googlemail.com \
    --cc=smatch@vger.kernel.org \
    --cc=tautschn@amazon.co.uk \
    /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