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

Commit

Permalink
Remove function allowlist (#2859)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranweiler authored Feb 18, 2023
1 parent 1ac3fd4 commit d5cff03
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 50 deletions.
1 change: 0 additions & 1 deletion src/ApiService/ApiService/OneFuzzTypes/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ public enum TaskFeature {
ReportList,
MinimizedStackDepth,
CoverageFilter,
FunctionAllowlist,
ModuleAllowlist,
SourceAllowlist,
TargetMustUseInput,
Expand Down
2 changes: 0 additions & 2 deletions src/ApiService/ApiService/OneFuzzTypes/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ public record TaskDetails(
// Deprecated. Retained for processing old table data.
string? CoverageFilter = null,

string? FunctionAllowlist = null,
string? ModuleAllowlist = null,
string? SourceAllowlist = null,
string? TargetAssembly = null,
Expand Down Expand Up @@ -1002,7 +1001,6 @@ Uri HeartbeatQueue
// Deprecated. Retained for processing old table data.
public string? CoverageFilter { get; set; }

public string? FunctionAllowlist { get; set; }
public string? ModuleAllowlist { get; set; }
public string? SourceAllowlist { get; set; }
public string? TargetAssembly { get; set; }
Expand Down
6 changes: 0 additions & 6 deletions src/ApiService/ApiService/onefuzzlib/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@ await _containers.GetContainerSasUrl(x.Item2.Name, StorageType.Corpus, ConvertPe
}
}

if (definition.Features.Contains(TaskFeature.FunctionAllowlist)) {
if (task.Config.Task.FunctionAllowlist != null) {
config.FunctionAllowlist = task.Config.Task.FunctionAllowlist;
}
}

if (definition.Features.Contains(TaskFeature.ModuleAllowlist)) {
if (task.Config.Task.ModuleAllowlist != null) {
config.ModuleAllowlist = task.Config.Task.ModuleAllowlist;
Expand Down
1 change: 0 additions & 1 deletion src/ApiService/ApiService/onefuzzlib/Defs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public static class Defs {
// Deprecated. Retained for processing old table data.
TaskFeature.CoverageFilter,

TaskFeature.FunctionAllowlist,
TaskFeature.ModuleAllowlist,
TaskFeature.SourceAllowlist,
},
Expand Down
7 changes: 0 additions & 7 deletions src/agent/coverage/examples/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ struct Args {
#[arg(long)]
module_allowlist: Option<String>,

#[arg(long)]
function_allowlist: Option<String>,

#[arg(long)]
source_allowlist: Option<String>,

Expand Down Expand Up @@ -63,10 +60,6 @@ fn main() -> Result<()> {
allowlist.modules = AllowList::load(path)?;
}

if let Some(path) = &args.function_allowlist {
allowlist.functions = AllowList::load(path)?;
}

if let Some(path) = &args.source_allowlist {
allowlist.source_files = AllowList::load(path)?;
}
Expand Down
6 changes: 0 additions & 6 deletions src/agent/coverage/src/allowlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@ use std::path::Path;

#[derive(Clone, Debug, Default)]
pub struct TargetAllowList {
pub functions: AllowList,
pub modules: AllowList,
pub source_files: AllowList,
}

impl TargetAllowList {
pub fn new(modules: AllowList, source_files: AllowList) -> Self {
// Allow all.
let functions = AllowList::default();

Self {
functions,
modules,
source_files,
}
Expand All @@ -28,7 +23,6 @@ impl TargetAllowList {
pub fn extend(&self, other: &Self) -> Self {
let mut new = Self::default();

new.functions = self.functions.extend(&other.functions);
new.modules = self.modules.extend(&other.modules);
new.source_files = self.source_files.extend(&other.source_files);

Expand Down
8 changes: 0 additions & 8 deletions src/agent/coverage/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ pub fn find_coverage_sites(
let mut offsets = BTreeSet::new();

for function in debuginfo.functions() {
if !allowlist.functions.is_allowed(&function.name) {
continue;
}

let blocks = block::sweep_region(module, &debuginfo, function.offset, function.size)?;

for block in &blocks {
Expand All @@ -133,10 +129,6 @@ pub fn find_coverage_sites(

// Apply allowlists per block, to account for inlining. The `location` values
// here describe the top of the inline-inclusive call stack.
if !allowlist.functions.is_allowed(&path) {
continue;
}

if !allowlist.source_files.is_allowed(&path) {
continue;
}
Expand Down
1 change: 0 additions & 1 deletion src/agent/onefuzz-task/src/local/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ pub fn build_coverage_config(
target_options,
target_timeout,
coverage_filter: None,
function_allowlist: None,
module_allowlist: None,
source_allowlist: None,
input_queue,
Expand Down
5 changes: 0 additions & 5 deletions src/agent/onefuzz-task/src/tasks/coverage/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ pub struct Config {
// Retained only to informatively fail tasks that were qeueued pre-upgrade.
pub coverage_filter: Option<String>,

pub function_allowlist: Option<String>,
pub module_allowlist: Option<String>,
pub source_allowlist: Option<String>,

Expand Down Expand Up @@ -161,10 +160,6 @@ impl CoverageTask {
// source files are excluded.
let mut allowlist = TargetAllowList::default();

if let Some(functions) = &self.config.function_allowlist {
allowlist.functions = self.load_allowlist(functions).await?;
}

if let Some(modules) = &self.config.module_allowlist {
allowlist.modules = self.load_allowlist(modules).await?;
}
Expand Down
2 changes: 0 additions & 2 deletions src/cli/onefuzz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,6 @@ def create(
colocate: bool = False,
report_list: Optional[List[str]] = None,
minimized_stack_depth: Optional[int] = None,
function_allowlist: Optional[str] = None,
module_allowlist: Optional[str] = None,
source_allowlist: Optional[str] = None,
) -> models.Task:
Expand Down Expand Up @@ -1057,7 +1056,6 @@ def create(
report_list=report_list,
preserve_existing_outputs=preserve_existing_outputs,
minimized_stack_depth=minimized_stack_depth,
function_allowlist=function_allowlist,
module_allowlist=module_allowlist,
source_allowlist=source_allowlist,
),
Expand Down
11 changes: 0 additions & 11 deletions src/cli/onefuzz/templates/libfuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def _create_tasks(
check_fuzzer_help: bool = True,
expect_crash_on_failure: bool = False,
minimized_stack_depth: Optional[int] = None,
function_allowlist: Optional[str] = None,
module_allowlist: Optional[str] = None,
source_allowlist: Optional[str] = None,
analyzer_exe: Optional[str] = None,
Expand Down Expand Up @@ -220,7 +219,6 @@ def _create_tasks(
debug=debug,
colocate=colocate_all_tasks or colocate_secondary_tasks,
check_fuzzer_help=check_fuzzer_help,
function_allowlist=function_allowlist,
module_allowlist=module_allowlist,
source_allowlist=source_allowlist,
)
Expand Down Expand Up @@ -327,7 +325,6 @@ def basic(
check_fuzzer_help: bool = True,
expect_crash_on_failure: bool = False,
minimized_stack_depth: Optional[int] = None,
function_allowlist: Optional[File] = None,
module_allowlist: Optional[File] = None,
source_allowlist: Optional[File] = None,
analyzer_exe: Optional[str] = None,
Expand Down Expand Up @@ -402,13 +399,6 @@ def basic(

target_exe_blob_name = helper.setup_relative_blob_name(target_exe, setup_dir)

if function_allowlist:
function_allowlist_blob_name: Optional[
str
] = helper.setup_relative_blob_name(function_allowlist, setup_dir)
else:
function_allowlist_blob_name = None

if module_allowlist:
module_allowlist_blob_name: Optional[str] = helper.setup_relative_blob_name(
module_allowlist, setup_dir
Expand Down Expand Up @@ -445,7 +435,6 @@ def basic(
check_fuzzer_help=check_fuzzer_help,
expect_crash_on_failure=expect_crash_on_failure,
minimized_stack_depth=minimized_stack_depth,
function_allowlist=function_allowlist_blob_name,
module_allowlist=module_allowlist_blob_name,
source_allowlist=source_allowlist_blob_name,
analyzer_exe=analyzer_exe,
Expand Down

0 comments on commit d5cff03

Please sign in to comment.