Magnus Morton via llvm-dev
2021-May-24 08:40 UTC
[llvm-dev] DataFlowSanitizer label overwriting
Hi, When using DataFlowSanitizer, I've noticed that assigning to a labelled location overwrites or removes that label. e.g. in this sample, the assert fails: int a = 5; dfsan_label a_label = dfsan_create_label("a", 0); dfsan_set_label(a_label, &a, sizeof(a)); a = 6; dfsan_label check = dfsan_read_label(&a, sizeof(a)); assert(dfsan_has_label(check, a_label)); Remove the a = 6 statement and the assert passes. This makes sense if the intended use of DataFlowSanitizer is taint analysis alone, but isn't helpful if I want to track how a particular memory location is used throughout a program and don't care what is stored in it or when. Is there a dfsan flag that retains the original label after a store? I've tried the obvious ones with no luck. Many thanks, Magnus