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

Commit

Permalink
disable sympath unless it's set via target_env (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc-msft authored Oct 28, 2020
1 parent 640091f commit 36bae9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
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) {
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

0 comments on commit 36bae9e

Please sign in to comment.