[PATCH] D109847: [DFSan] Add force_zero_label abilist option to DFSan. This can be used as a work-around for overtainting.

Andrew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 16 10:23:06 PDT 2021


browneee added a comment.

The motivation for this change is to remove taint in functions which write out their return data...

e.g.

  void GenerateData(char* out_buf, int out_buf_len) { ... }

This feature allows us to untaint the data produced by this function.



================
Comment at: compiler-rt/test/dfsan/Inputs/force_zero_abilist.txt:1
-fun:f=uninstrumented
+fun:function_to_force_zero=force_zero_labels
 
----------------
morehouse wrote:
> Why a separate abilist.txt?
For separate test. Happy to combine them if you prefer.


================
Comment at: compiler-rt/test/dfsan/force_zero.c:25
+  assert(dfsan_get_label(out) == 0);
+  assert(dfsan_get_label(ret) == 0);
+#else
----------------
morehouse wrote:
> Wouldn't this also pass if we used `uninstrumented` or `discard` in the ABI list?
For the return value yes, but not for the shadow of the contents of the the out pointer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109847/new/

https://reviews.llvm.org/D109847



More information about the llvm-commits mailing list