Support for larger DFSan labels

Hi, I had a question about ongoing DFSan development and wanted to potentially upstream some features.

Currently, in DFSan the label size is uint16, is anyone against bumping it to be a uint32? I found this modification to be needed to run DFSan on programs like document parsers.

Thanks for your time,

Carson

Hi, I had a question about ongoing DFSan development and wanted to potentially upstream some features.

Currently, in DFSan the label size is uint16, is anyone against bumping it to be a uint32?

That would cause a substantial increase in memory overhead. The size
of the shadow memory region would need to double.

I found this modification to be needed to run DFSan on programs like document parsers.

Can you give some details on why you need so many labels? How many
are you allocating?

Programs can run out of labels due to linking issues that mix
instrumented and uninstrumented code. Arguments intended for
uninstrumented code are interpreted as labels. The unions of these
incorrect labels consume more labels as they are unioned. To see if
you are hitting such an issue:

1) Disable all calls to dfsan_set_label(), so that no labels are set
by your code. A search-and-replace that comments out all the lines is
one way to do this.

2) Build and run your binary, with the environment variable
"DFSAN_OPTIONS" set to "warn_nonzero_labels=1". No labels are set, so
any warning about a set label you see indicates an issue.