Instructions
Note that a detailed description of this example is provided in the
SATABS user manual.
If you encounter problems when following the brief instructions in
this section please refer to the manual.
- Download the tarballs (see above) and unpack
the files.
- The file aeon_satabs.tgz contains a patch (
aeon.diff)
which has to be applied to the original Aeon sources in aeon-0.2a.tar.gz.
Call
patch -p0 < aeon.diff
in the parent directory of aeon-0.2a/.
Alternatively, if the patch tool is not installed on your computer, change
#define MAX_LEN 512 in aeon-0.2a/aeon.h to #define MAX_LEN 50.
This is a limitation due to a performance issue of the SATABS simulator and will be
removed soon.
- We assume you have unpacked the original Aeon sources to the directory
aeon-0.2a/,
the include files to include/ and stub.c to the directory stubs/.
- Run
satabs --show-claims --model-checker boppo --loop-detection -I include/ aeon-0.2a/aeon.c
aeon-0.2a/base64.c aeon-0.2a/lib_aeon.c stubs/stubs.c
Ignore the warnings that the bodies of several functions are missing. All relevant function bodies
are supplied in stubs.c.
- Inspect following claim:
Claim 5:
file stubs/stubs.c line 8 column 10 function c::strcpy
dereference failure: array `home' upper bound
!(dest == &home[0]) || !(i >= 50)
This claim refers to the call
strcpy(home, getenv("HOME")); /* get home path */
in the function getConfig in lib_aeon.c (line 19).
This function is called at the beginning of the main function of Aeon.
The claim states that the upper bound of the array home
(which is of size MAX_LEN) must not be violated.
- Try to verify the claim by calling
satabs --claim 5 --model-checker boppo --loop-detection -I include/ aeon-0.2a/aeon.c
aeon-0.2a/base64.c aeon-0.2a/lib_aeon.c stubs/stubs.c
After a while, SATABS will provide a counterexample trace that illustrates
how the call to strcpy in combination with getenv can result
in a buffer overflow. This buffer overflow is also listed by NIST/US-CERT
(Vulnerability Summary CVE-2005-1019).
The implementation of getenv in stubs.c demonstrates
how (potentially malific) external input can be modeled using non-determinism
(refer to the manual for a detailed
explanation).
|