From: "Dan Carpenter" <error27@gmail.com>
To: smatch-discuss@lists.sf.net
Cc: linux-sparse@vger.kernel.org
Subject: Re: Moving smatch to use sparse
Date: Thu, 5 Oct 2006 01:41:03 -0700 [thread overview]
Message-ID: <a63d67fe0610050141x251253fei59b93fff28505dc4@mail.gmail.com> (raw)
In-Reply-To: <a63d67fe0607151742l6a387783x59494b84de80be88@mail.gmail.com>
Work on smatch is going ahead. I have one real life check is working
and I've added a patched up the core code quite a bit.
Makefile | 15
check_derefed_params.c | 171 +++++
check_null_deref.c | 178 +++++
smatch.c | 33 +
smatch.h | 138 ++++
smatch_flow.c | 462 ++++++++++++++
smatch_helper.c | 180 +++++
smatch_hooks.c | 125 ++++
smatch_states.c | 587 +++++++++++++++++++
9 files changed, 1888 insertions(+), 1 deletion(-)
check_derefed_params prints out a message every time a function
dereferences a parameter without checking. check_null_deref.c prints
out a message whenever code calls a funtion with possibly null
parameters. Afterwards you sort the output for functions that are in
both lists like this:
grep Und warns.out | cut -d ' ' -f 6,7 | sort | uniq > tmp
grep unchecked warns.out | cut -d ' ' -f 7,8 | sort | uniq > tmp2
cat tmp* | sort | uniq -c | sort -n | grep " 2 "
If you run the code with an allno config then you get 9 potential
errors but only one is real...
In drivers/char/tty_ioctl.c line 549, ld could possibly NULL if arg is
TCIFLUSH, TCIOFLUSH or TCOFLUSH which leads to a BUG_ON when
tty_ldisc_deref() is called.
It kind sucks to get so many false positives, but the old version of
smatch would have had more even more because it wasn't as good at
handling compound conditions.
The code is on: http://smatch.sourceforge.net/sparse/
regards,
dan carpenter
next prev parent reply other threads:[~2006-10-05 8:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <a63d67fe0607140925h3665cd98ibc2fab07f6f80360@mail.gmail.com>
2006-07-16 0:42 ` Moving smatch to use sparse Dan Carpenter
2006-10-05 8:41 ` Dan Carpenter [this message]
2006-10-05 9:26 ` Sam Ravnborg
2006-10-05 9:49 ` Dan Carpenter
2006-10-05 10:25 ` Jörn Engel
2006-10-06 6:31 ` Dan Carpenter
2006-10-05 15:52 ` Michael Stefaniuc
2006-10-05 20:58 ` Dan Carpenter
2006-10-05 22:46 ` Michael Stefaniuc
2006-10-06 8:57 ` Dan Carpenter
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=a63d67fe0610050141x251253fei59b93fff28505dc4@mail.gmail.com \
--to=error27@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=smatch-discuss@lists.sf.net \
/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).