You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wei Ming Khoo edited this page Aug 5, 2020
·
4 revisions
There are at least three types of taint dependency. Let x be tainted.
Direct/Data-flow dependence, e.g. y = x
Indirect/Control-flow dependence, e.g. if(x){ y = 2; }
Address/Pointer dependence, e.g. y = a[x] and y = *x
Taintgrind, which follows Valgrind memcheck, only implements 1, not 2 or 3. This means it will under-taint, i.e. it will miss some dependencies. On the other hand, it is tricky to handle 2 and 3, as it may lead to over-tainting, i.e. reporting dependencies where there is none.
char output[256];
long input = user_input();
long len = 0;
if (input > 100) {
strcpy(output, "large");
len = 5;
} else {
strcpy(output, "small");
len = 5;
}
print_output(output, len);
In this case, len has a control-flow dependence on input. However, len is not dependent on input because it is 5 no matter which branch is taken, so transferring taint from input to len may be considered incorrect.
Other Dynamic Taint Analysis Tools
Some other dynamic taint analysis tools I'm aware of, but have not tried (and the info may not be up-to-date):
bap: If you want to experiment with and implement different taint rules, I hear that bap will let you do that (but again, I have not tried it).
polytracker: Polytracker is an LLVM pass that instruments the programs it compiles to track which bytes of an input file are operated on by which functions. It outputs a JSON file containing the function-to-input-bytes mapping.