lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 May 2017 13:18:38 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     linux-kbuild <linux-kbuild@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: sparse on scripts/kconfig/*.c

On Tue, May 09, 2017 at 09:47:41AM -0700, Randy Dunlap wrote:
> Hi,
> 
> I've been attempting to run sparse on the kconfig/ C files -- without success.
> 
> The kbuild files don't try to support CHECK in scripts/kconfig/ AFAICT,
> and just running sparse on the C files has issues with not being able to
> find header files.
> 
> Has anyone done this?  Any clues about how to do it?
> 

Smatch has pretty much only been used on kernel code, and it really
shows.  For userspace code, you'd want to make a list of the no return
functions and some other customizations.  Also the kernel uses a quite
limitted sample of C.

Anyway, what Christophe said is right.  Change the Makefile:
-HOSTCC       = gcc
+HOSTCC       = ~/progs/smatch/devel/cgcc

make CHECK="~/progs/smatch/devel/smatch --file-output" scripts/kconfig/
find -name \*.c.smatch -exec cat \{\} \; > smatch_warns.txt

I just did that now, and there is nothing interesting there.  If there
were something there, then there is a good chance I would have seen it
already because I've been running smatch_scripts/kchecker on every .c
file.  Say you don't have your .config set up for sparc then it doesn't
really work great, but what it does it uses the x86 headers but if there
are any header files missing it just includes a promising header with
the same name or it continues without the .h file.  The output is mostly
garbage but I had five sparc patches merged in 2016 so I'm a top ten
sparc dev for the year.  :P

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ