Closed rshariffdeen closed 1 year ago
This is the same failure mode as #134. Dealing with this is tricky since it's an issue in Clang itself and not in the way that we interact with LibTooling. Possibly the best intervention is for us to preprocess src/libtiff/tif_unix.c
. I'll take a look into it.
I'm in the process of testing out a promising fix to these libtiff parsing issues 🤞🏻
I manually performed the following change (this will eventually go into setup.sh
):
cd src
clang -I . -I ./libtiff -E tools/tiffcrop.c > tools/tiffcrop.c.pre
mv tools/tiffcrop.c.pre tools/tiffcrop.c
Unfortunately I now get a crash during the analysis phase:
Generating Fix Locations
__________________________________________________________________________________________
generating taint map
[info] found 6210 tainted locations
starting parallel computing
waiting for thread completion
[info] found 7 source files
Runtime Error
[Errno 2] No such file or directory: '/data/vulnloc/libtiff/CVE-2016-10092/src/tools/tools/tiffcrop.c.ast'
Was there additional changes? the path seems to be wrong, there is no src/tools/tools directory?
Was there additional changes? the path seems to be wrong, there is no src/tools/tools directory?
Those were the only changes. You should be able to reproduce.
I think the preprocessor comments created changes the debug meta-data so the debug information shows the path as tools/tools/tiffcrop.c
instead of tools/tiffcrop.c
If we remove the pre-processing comments this will work, which is what I did for other subjects when pre-processing.
clang -I . -I ./libtiff -E tools/tiffcrop.c > tools/tiffcrop.c.pre
grep -o '^[^#]*' tools/tiffcrop.c.pre > tools/tiffcrop.c
the command should be updated as below:
grep -v '^ *#' tools/tiffcrop.c.pre > tools/tiffcrop.c.post
The above does the trick. I'll update the setup.sh
files.
Repair module cannot find fix-location, ignores developer fix location