Page MenuHomePhabricator

[libFuzzer] Don't prefix absolute paths in fuchsia.
ClosedPublic

Authored by charco on Oct 10 2019, 3:20 AM.

Details

Summary

The ExecuteCommand function in fuchsia used to prefix the
getOutputFile for each command run with the artifact_prefix flag if
it was available, because fuchsia components don't have a writable working
directory. However, if a file with a global path is provided, fuchsia
should honor that.

An example of this is using the global /tmp directory to store stuff.
In fuchsia it ended up being translated to data///tmp, whereas we want
to make sure it is using /tmp (which is available to components using the
isolated-temp feature).

To test this I made the change, compiled fuchsia with this toolchain and
ran a fuzzer with the -fork=1 flag (that mode makes use of the /tmp
directory). I also tested that normal fuzzing workflow was not affected
by this.

Diff Detail

Event Timeline

charco created this revision.Oct 10 2019, 3:20 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 10 2019, 3:20 AM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
aarongreen accepted this revision.Oct 10 2019, 6:31 PM
This revision is now accepted and ready to land.Oct 10 2019, 6:31 PM
phosek added inline comments.Oct 10 2019, 6:59 PM
compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
415

Nit: no curly braces for block with a single statement (LLVM style).

charco updated this revision to Diff 224525.Oct 10 2019, 7:26 PM

Remove brackets on ifs conditions

charco marked 2 inline comments as done.Oct 10 2019, 7:28 PM
charco added inline comments.
compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
415

Thanks! I didn't know about this rule. Could you point me to where it is defined? I checked http://llvm.org/docs/CodingStandards.html#source-code-formatting and also tried to see if clang-format -style=LLVM catched it but nothing.

charco marked an inline comment as done.Oct 10 2019, 7:31 PM
This revision was automatically updated to reflect the committed changes.