Powered by Linux
Re: smatch validation tests fail — Semantic Matching Tool

Re: smatch validation tests fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux