smatch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Norbert Manthey <nmanthey@amazon.de>
Cc: smatch@vger.kernel.org,
	"Julian Stecklina (jsteckli)" <jsteckli@amazon.de>
Subject: Re: smatch validation tests fail
Date: Mon, 6 Aug 2018 12:53:05 +0300	[thread overview]
Message-ID: <20180806095305.jielv2ovojmp3zti@mwanda> (raw)
In-Reply-To: <14c0dce0-1184-79f5-22e1-ce54b35ff4ce@amazon.de>

On Fri, Aug 03, 2018 at 04:03:47PM +0200, Norbert Manthey wrote:
> Dear Dan,
> 
> I started to look into porting smatch to be applicable to other code
> bases and projects. When trying to get taint analysis working for Xen, I
> also gave the validation tests of smatch a try and noticed that
> user_data test 3 fails. I attached the relevant part of the log of my
> call. Is that failure a known problem that I should ignore, or might
> this bug explain why taint analysis for Xen is not working as it's
> working for Linux (essentially, I added copy_from_guest where smatch
> uses copy_from_user). This is what I executed:
> 
> git rev-parse --short HEAD
> b787aa7
> make check &> check.log; echo $?
> 2

Thanks...  I've fixed the bug now.  The problem was that if you have
something like:

struct whatever *frob(struct whatever *p)
{
	return p;
}

The p variable is both a parameter and the return.  It was only
recording the parameter stuff instead of both.

I really doubt it makes a difference for Xen but I've pushed the change.

> 
> Furthermore, I wonder whether smatch is sensitive to the current working
> directory. While for Linux, gcc seems to be called from the repository
> root each time, in Xen gcc is called next to the current source file. In
> case I run smatch in addition to each Xen gcc call, the current working
> directory will be different as well. Is that a problem for smatch, or
> can I expect it to behave as for the kernel? Unfortunately, I did not
> find anything about this behavior in the docs.
> 

Yeah.  It probably is.  You could try building with --full-path.  I'll
test that and see if I can make it work.

regards,
dan carpenter


      reply	other threads:[~2018-08-06 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 14:03 smatch validation tests fail Norbert Manthey
2018-08-06  9:53 ` Dan Carpenter [this message]

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=20180806095305.jielv2ovojmp3zti@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jsteckli@amazon.de \
    --cc=nmanthey@amazon.de \
    --cc=smatch@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).