Ibéria Medeiros | 4 Oct 03:41 2007
Picon

tainted analysis with splint

Hi,

i am trying make tainted analysis with splint, across extensible checking.
My support for do that is the example tainted.mts (come with splint tool), where the principal purpose is detect format string bugs.

My goal for tainted analysis is signalize every input variables, read across input functions, with tainted state.  I create the attribute taintness (file .mts) and create the file .xh with every input functions, where i annotated every returned parameters with tainted annotation. For example,

extern char *fgets (/* <at> returned <at> */ char *s, int n, FILE *stream)
/* <at> ensures tainted s <at> */;

in fgets function i ensure *s is tainted.

My problem is how can i do that to function scanf or sscanf, where the returned parameter is ... (
extern int scanf(const char *format, ...))

I have trying the next declaration, but splint give me a error

extern int scanf(const char *format, ...)
/* <at> ensures tainted ... <at> */;

any help, please

regards
--
Ibéria Medeiros
_______________________________________________
splint-discuss mailing list
splint-discuss@...
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss
Jack Sparrow | 11 Oct 16:58 2007
Picon

splint usage

Hi,

I am new to splint and currently trying it on my source which also has a collection of independent libraries. When I try running splint :


splint abc_main.c -I ${bca_project_path}/oss/src ${bca_project_path}/oss/h ${bca_project_path}/cd/h ${bca_project_path}/abc/h ${bac_project_path}/abc/bca/h ${bca_project_path}/abc/caldrv/h ${bca_project_path}/bsp/h ${bca_project_path}/sad/h ${abc_project_path}/lib /abc/xsgaag/com2/h ${bca_project_path}/cos/src +posixlib -preproc


This is the output I get:

Spec file not found: ../../oss/h.lcl
Spec file not found: ../../cd/h.lcl
Spec file not found: ../h.lcl
Spec file not found: ../cdm/h.lcl
Spec file not found: ../caldrv/h.lcl
Spec file not found: ../../bsp/h.lcl
Spec file not found: ../../sad/h.lcl
Spec file not found: ../../lib.lcl
Spec file not found: ../../com2/h.lcl
Spec file not found: ../../com2/src.lcl
Cannot open file: ../../oss/h.c
Cannot open file: ../../cd/h.c
Cannot open file: ../h.c
Cannot open file: ../cdm/h.c
Cannot open file: ../caldrv/h.c
Cannot open file: ../../bsp/h.c
Cannot open file: ../../sad/h.c
Cannot open file: ../../lib.c
Cannot open file: ../../com2/h.c
Cannot open file: ../../com2/src.c
abc_main.c:84:11: Parse Error. (For help on parse errors, see splint -help
               parseerrors.)
*** Cannot continue.

What seems to be the problem here? Am I missing some flag while invoking splint?

Thanks.

_______________________________________________
splint-discuss mailing list
splint-discuss@...
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss
Peter C. Chapin | 12 Oct 05:37 2007

Problems finding standard.lcd

Hi! I'm using splint v3.1.1 on Windows. I realize Windows is not
officially supported, but I'm hoping someone might have some insight
into this issue anyway.

I've installed splint to c:\lib\splint-3.1.1. I have the LARCH_PATH and
LCLIMPORTDIR environment variables set appropriately. However, splint
behaves as if it can't find standard.lcd. Specifically it acts as if it
has no knowledge of the C standard library functions.

If I manually copy c:\lib\splint-3.1.1\lib\standard.lcd to my working
directory and use the "-load standard" command line option, things work
as they should. This is an acceptable solution, although it is
inelegant. If I delete standard.lcd from my working directory and try
"-load c:\lib\spint-3.1.1\lib\standard" I get the error

Cannot open dump file for loading: c:\lib\splint-3.1.1\lib\standard
*** Cannot continue.

I tried using forward slashes instead of backslashes and I tried
deleting the drive specifier from the name. Neither of these approaches
worked. Is this related to the non-support of Windows or am I just doing
something stupid?

Thanks!

Peter

P.S. I've just started using splint but it has already found a couple of
issues in my code that I hadn't thought about. Cool.

Attachment (Peter.Chapin.vcf): text/x-vcard, 336 bytes
_______________________________________________
splint-discuss mailing list
splint-discuss@...
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss
Matuschka, Sebastian | 12 Oct 08:18 2007
Picon

Re: Problems finding standard.lcd

Hi,

I'm using splint on windows too, and it works well.
Maybe you have to restart your IDE or your PC so the environment variables are set and known correctly. That
was my problem at the beginning.

> -----Ursprüngliche Nachricht-----
> Von: splint-discuss-bounces@... [mailto:splint-discuss-
> bounces@...] Im Auftrag von Peter C. Chapin
> Gesendet: Freitag, 12. Oktober 2007 05:37
> An: Splint Discussion
> Betreff: [splint-discuss] Problems finding standard.lcd
> 
> Hi! I'm using splint v3.1.1 on Windows. I realize Windows is not
> officially supported, but I'm hoping someone might have some insight
> into this issue anyway.
> 
> I've installed splint to c:\lib\splint-3.1.1. I have the LARCH_PATH and
> LCLIMPORTDIR environment variables set appropriately. However, splint
> behaves as if it can't find standard.lcd. Specifically it acts as if it
> has no knowledge of the C standard library functions.
> 
> If I manually copy c:\lib\splint-3.1.1\lib\standard.lcd to my working
> directory and use the "-load standard" command line option, things work
> as they should. This is an acceptable solution, although it is
> inelegant. If I delete standard.lcd from my working directory and try
> "-load c:\lib\spint-3.1.1\lib\standard" I get the error
> 
> Cannot open dump file for loading: c:\lib\splint-3.1.1\lib\standard
> *** Cannot continue.
> 
> I tried using forward slashes instead of backslashes and I tried
> deleting the drive specifier from the name. Neither of these approaches
> worked. Is this related to the non-support of Windows or am I just doing
> something stupid?
> 
> Thanks!
> 
> Peter
> 
> P.S. I've just started using splint but it has already found a couple of
> issues in my code that I hadn't thought about. Cool.
Matuschka, Sebastian | 12 Oct 08:14 2007
Picon

Re: splint usage

Hi,

 

you have a space after the –I flag, if you want to tell Splint where your Include directory is, you must type the path directly after the –I, no space or something else.

Otherwise, like you typed it now, splint thinks those h things at the end of each path are files which should be checked and you forgot to add .c or .lcl, adds it and tries to open it.

 

Best Regards

 

Sebastian

 

Von: splint-discuss-bounces-PtzpWEKHOf7sOVejVcbrAg@public.gmane.org [mailto:splint-discuss-bounces-PtzpWEKHOf7sOVejVcbrAg@public.gmane.org] Im Auftrag von Jack Sparrow
Gesendet: Donnerstag, 11. Oktober 2007 16:59
An: splint-discuss-0Lw5bexNw1zg2DoN+sQYgPZ8FUJU4vz8@public.gmane.org
Betreff: [splint-discuss] splint usage

 

Hi,

I am new to splint and currently trying it on my source which also has a collection of independent libraries. When I try running splint :

 

splint abc_main.c -I ${bca_project_path}/oss/src ${bca_project_path}/oss/h ${bca_project_path}/cd/h ${bca_project_path}/abc/h ${bac_project_path}/abc/bca/h ${bca_project_path}/abc/caldrv/h ${bca_project_path}/bsp/h ${bca_project_path}/sad/h ${abc_project_path}/lib /abc/xsgaag/com2/h ${bca_project_path}/cos/src +posixlib -preproc


This is the output I get:

Spec file not found: ../../oss/h.lcl
Spec file not found: ../../cd/h.lcl
Spec file not found: ../h.lcl
Spec file not found: ../cdm/h.lcl
Spec file not found: ../caldrv/h.lcl
Spec file not found: ../../bsp/h.lcl
Spec file not found: ../../sad/h.lcl
Spec file not found: ../../lib.lcl
Spec file not found: ../../com2/h.lcl
Spec file not found: ../../com2/src.lcl
Cannot open file: ../../oss/h.c
Cannot open file: ../../cd/h.c
Cannot open file: ../h.c
Cannot open file: ../cdm/h.c
Cannot open file: ../caldrv/h.c
Cannot open file: ../../bsp/h.c
Cannot open file: ../../sad/h.c
Cannot open file: ../../lib.c
Cannot open file: ../../com2/h.c
Cannot open file: ../../com2/src.c
abc_main.c:84:11: Parse Error. (For help on parse errors, see splint -help
               parseerrors.)
*** Cannot continue.

What seems to be the problem here? Am I missing some flag while invoking splint?

Thanks.

 

_______________________________________________
splint-discuss mailing list
splint-discuss@...
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss
Peter C. Chapin | 12 Oct 13:25 2007

Re: Problems finding standard.lcd

Matuschka, Sebastian wrote:

> I'm using splint on windows too, and it works well.
> Maybe you have to restart your IDE or your PC so the environment variables are set and known correctly. That
was my problem at the beginning.
>   

Thanks for your note. I don't think that's the problem because I
installed splint some time ago; I've only just recently started a
project using it. My machine has been rebooted several times since I did
the install.

I have since realized that I will probably have to create a local copy
of standard.lcd anyway. I'm using OpenSSL in my project and I'll need to
provide some annotations for the OpenSSL functions that I use. Thus I
will need to compile a splint library for that purpose. I notice that
splint only allows a single library to be loaded, so that means I'll
need to merge the OpenSSL stuff into standard.h in order to compile them
together. Consequently splint's troubles finding standard.lcd in the
installation directories is moot for me now.

Peter

Attachment (Peter.Chapin.vcf): text/x-vcard, 336 bytes
_______________________________________________
splint-discuss mailing list
splint-discuss@...
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss
Michael Wojcik | 12 Oct 15:41 2007

Re: splint usage


> From: splint-discuss-bounces@...
[mailto:splint-discuss-bounces@...] On Behalf Of Matuschka,
Sebastian
> Sent: Friday, 12 October, 2007 02:14

> you have a space after the -I flag, if you want to tell Splint
> where your Include directory is, you must type the path directly
> after the -I, no space or something else.

More specifically, that's "-I", no space, and the path *for each of your
include directories*. What you have now is "-I", a space, and then a
list of include directories separated by spaces.

So what you want is something like:

splint abc_main.c -I${bca_project_path}/oss/src \
   -I${bca_project_path}/oss/h \
   -I${bca_project_path}/cd/h ...

--

-- 
Michael Wojcik
Principal Software Systems Developer, Micro Focus
brosenth | 12 Oct 16:58 2007
Picon
Picon

Parsing errors

New to splint, so sorry if this post has already been addressed in the past.
 
Trying to parse source that is kernel module source and am getting numerous parse errors. Specifically, I am trying to parse e.g. iptables code (actually, netfilter code) like ip_conntrack_proto_sctp.c from a LK 2.6.9-xx source.
 
splint complains about not being able to parse things like __u32int and the like. Basically, about a dozen or so defines from /linux/types.h which is the first include in the source file noted above.
 
I have created a .splintrc that I am populating with -Dxxx=yyy directives as these occur in running splint. Wound up with about 14 of these. Then, splint complains about not being able to parse the fs_struct.h which is an include in the sched.h
 
Tried having -I directives in the command line like -I/usr/src/linux/include/linux/ and the like - still no go.
 
Also tried +posixlib and +unixlib - still no go
 
I gave up at this point.
 
Doesn't seem like it should take this much effort but maybe it does. Or maybe I'm missing something more obvious.
 
--
Bruce Rosenthal
Chief Architect, TranStrophe
Turning Information and Technology Into Business Opportunities

505 521 4879
510 432 7912
_______________________________________________
splint-discuss mailing list
splint-discuss@...
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss
Jack Sparrow | 12 Oct 18:16 2007
Picon

Parse error:

Some of the code which I am testing using splint is giving me a parse error.
I am running a linux-2.6.9 kernel:

$splint abcd_main.cpp -I ${abc_project_path}/xx/h


The output is:

Splint 3.1.1 --- 15 Jun 2004

/usr/include/bits/sigthread.h:33:18: Parse Error:
    Inconsistent function parameter syntax: __sigset_t :
    <any>. (For help on parse errors, see splint -help parseerrors.)
*** Cannot continue.


What seems to be the problem?

Thanks.

_______________________________________________
splint-discuss mailing list
splint-discuss@...
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss
Jack Sparrow | 15 Oct 16:43 2007
Picon

Re: splint usage

Hi,

Thanks for the comments, I got rid of the above error. However, I am now getting a parse error after running splint on the same se of source files, which says:

usr/include/bits/sigthread.h:33:18: Parse Error:
    Inconsistent function parameter syntax: __sigset_t :
    <any>. (For help on parse errors, see splint -help parseerrors.)

This is after adding the following flags:

-prepoc, -filextensions, +trytorecover, +posixlib.

How can correct this error?

Thanks.

On 10/12/07, Michael Wojcik <Michael.Wojcik-/y5eVf3Am6FByuSxxbvQtw@public.gmane.org > wrote:

> From: splint-discuss-bounces-PtzpWEKHOf7sOVejVcbrAg@public.gmane.org
[mailto:splint-discuss-bounces-PtzpWEKHOf7sOVejVcbrAg@public.gmane.org] On Behalf Of Matuschka,
Sebastian
> Sent: Friday, 12 October, 2007 02:14

> you have a space after the -I flag, if you want to tell Splint
> where your Include directory is, you must type the path directly
> after the -I, no space or something else.

More specifically, that's "-I", no space, and the path *for each of your
include directories*. What you have now is "-I", a space, and then a
list of include directories separated by spaces.

So what you want is something like:

splint abc_main.c -I${bca_project_path}/oss/src \
   -I${bca_project_path}/oss/h \
   -I${bca_project_path}/cd/h ...

--
Michael Wojcik
Principal Software Systems Developer, Micro Focus

_______________________________________________
splint-discuss mailing list
splint-discuss-0Lw5bexNw1zg2DoN+sQYgPZ8FUJU4vz8@public.gmane.org
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss

_______________________________________________
splint-discuss mailing list
splint-discuss@...
http://www.cs.virginia.edu/mailman/listinfo/splint-discuss

Gmane