Last active
November 16, 2016 14:09
-
-
Save rubienr/ab40a347e3236a2844d918ad5828a6b8 to your computer and use it in GitHub Desktop.
Revisions
-
rubienr revised this gist
Nov 16, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ * canary detection * gcc ... -fstack-protector -fstack-protector-all * gcc ... -fmudflap -fmudflapth -fmudflapir * For front-ends that support it (C and C++), instrument all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with range/validity tests. Modules so instrumented should be immune to -
rubienr revised this gist
Nov 16, 2016 . 1 changed file with 6 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,19 +4,18 @@ --track-origins=yes ./a.out * clang * sudo apt-get install clang * cd <c4_dir> * make clean * scan-build -V make * splint ./*.c * rats ./*.c * canary detection * gcc ... -fstack-protector -fstack-protector-all * gcc ... -fmudflap -fmudflapth -fmudflapir For front-ends that support it (C and C++), instrument all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with -
rubienr created this gist
Nov 16, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ * cppcheck --enable all ./* * valgrind --tool=memcheck --leak-check=full --show-reachable=yes --track-origins=yes ./a.out * clang sudo apt-get install clang cd <c4_dir> make clean scan-build -V make * splint ./*.c * rats ./*.c * canary detection gcc ... -fstack-protector -fstack-protector-all * gcc ... -fmudflap -fmudflapth -fmudflapir For front-ends that support it (C and C++), instrument all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with range/validity tests. Modules so instrumented should be immune to buffer overflows, invalid heap use, and some other classes of C/C++ programming errors. The instrumentation relies on a separate runtime library (libmudflap), which will be linked into a program if -fmudflap is given at link time. Run-time behavior of the instrumented program is controlled by the MUDFLAP_OPTIONS environment variable. See "env MUDFLAP_OPTIONS=-help a.out" for its options. Use -fmudflapth instead of -fmudflap to compile and to link if your program is multi-threaded. Use -fmudflapir, in addition to -fmudflap or -fmudflapth, if instrumentation should ignore pointer reads. This produces less instrumentation (and therefore faster execution) and still provides some protection against outright memory corrupting writes, but allows erroneously read data to propagate within a program.