Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

disable sympath in libfuzzer_coverage extraction unless it's set via target_env #222

Merged
merged 2 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/agent/onefuzz-agent/src/tasks/coverage/recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,13 @@ impl CoverageRecorder {
.join("libfuzzer-coverage")
.join("DumpCounters.js");

let should_disable_sympath = !self.config.target_env.contains_key("_NT_SYMBOL_PATH");

let cdb_cmd = format!(
".scriptload {}; !dumpcounters {:?}; q",
".scriptload {}; !dumpcounters {:?}, {}; q",
script_path.to_string_lossy(),
output.to_string_lossy()
output.to_string_lossy(),
should_disable_sympath,
);

let mut cmd = Command::new("cdb.exe");
Expand Down
11 changes: 9 additions & 2 deletions src/agent/script/win64/libfuzzer-coverage/DumpCounters.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ function processModule(module, results_dir) {
return true;
}

function dumpCounters(results_dir, sample_name) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, sample_name was not provided by any of the users of this script and was only used to pass to a function that didn't have it as an argument.

function dumpCounters(results_dir, should_disable_sympath) {
if (should_disable_sympath == true) {
logln(`disabling sympath`);
execute('.sympath ""');
} else {
logln(`not disabling sympath`);
}

// Reset to initial break in `ntdll!LdrpDoDebuggerBreak`.
execute(".restart");

Expand All @@ -95,7 +102,7 @@ function dumpCounters(results_dir, sample_name) {

let found = false;
host.currentProcess.Modules.All(function (module) {
let result = processModule(module, results_dir, sample_name);
let result = processModule(module, results_dir);
if (result) {
found = true;
}
Expand Down