The dataset viewer is not available for this split.
Error code: FeaturesError Exception: ParserError Message: Error tokenizing data. C error: Expected 1 fields in line 34, saw 2 Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 233, in compute_first_rows_from_streaming_response iterable_dataset = iterable_dataset._resolve_features() File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2998, in _resolve_features features = _infer_features_from_batch(self.with_format(None)._head()) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1918, in _head return _examples_to_batch(list(self.take(n))) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2093, in __iter__ for key, example in ex_iterable: File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1576, in __iter__ for key_example in islice(self.ex_iterable, self.n - ex_iterable_num_taken): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 279, in __iter__ for key, pa_table in self.generate_tables_fn(**gen_kwags): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/csv/csv.py", line 190, in _generate_tables for batch_idx, df in enumerate(csv_file_reader): File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1843, in __next__ return self.get_chunk() File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1985, in get_chunk return self.read(nrows=size) File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1923, in read ) = self._engine.read( # type: ignore[attr-defined] File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 234, in read chunks = self._reader.read_low_memory(nrows) File "parsers.pyx", line 850, in pandas._libs.parsers.TextReader.read_low_memory File "parsers.pyx", line 905, in pandas._libs.parsers.TextReader._read_rows File "parsers.pyx", line 874, in pandas._libs.parsers.TextReader._tokenize_rows File "parsers.pyx", line 891, in pandas._libs.parsers.TextReader._check_tokenize_status File "parsers.pyx", line 2061, in pandas._libs.parsers.raise_parser_error pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 34, saw 2
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Function and BasicBlock Binary Classification Features based on NIST Juliet1.3 C/C++
The final Basic Block and Function features are extracted in Semicolon-Separated Values (SSV) format.
To load in pandas, use -
import pandas as pd
data = pd.read_csv("FNFeatures.csv", sep=";")
Assuming FNFeatures.csv
is the target feature file.
Function Features
The generated dataset is list of functions with various characteristics and a label indicating whether each function is vulnerable or not. The data is structured into 14 columns, which are described below:
- Function ID: A unique identifier for each function.
- Function Name: The name of the function.
- Instructions: The number of instructions (e.g.,Intermediate Instructions) in the function.
- BBs (Basic Blocks): The number of basic blocks in the function. A basic block is a sequence of instructions that are executed together without any control flow changes.
- In-degree: The number of incoming edges to the function in the call graph, indicating how many other functions call this one.
- Out-degree: The number of outgoing edges from the function in the call graph, indicating how many other functions are called by this one.
- Num Loops: The number of loops (e.g., for, while, do-while) present in the function.
- Static Allocations: The number of static memory allocations made by the function.
- Dynamic Allocations: The number of dynamic memory allocations made by the function (e.g., using
malloc
,realloc
). - MemOps (Memory Operations): The number of memory-related operations performed by the function (e.g., reads, writes).
- CondBranches (Conditional Branches): The number of conditional branches (e.g., if-else statements) in the function.
- UnCondBranches (Unconditional Branches): The number of unconditional branches (e.g., jumps, returns) in the function.
- DirectCalls: The number of direct function calls made by the function.
- InDirectCalls (Indirect Calls): The number of indirect function calls made by the function (e.g., through a pointer or a table).
- VULNERABLE: A binary label indicating whether the function is vulnerable (1) or not (0).
Basic Block Features
Generated Basic Block dataset a collection of basic blocks (BBs) from functions with various characteristics and a label indicating whether each block is vulnerable or not. The data is structured into 13 columns, which are described below:
- Block ID: A unique identifier for each basic block.
- Block Name: Name of the block with following structure -
BB_<block #>_<demangled parent function>
- Instructions: The number of instructions (e.g., assembly code operations) in the basic block.
- In-degree: The number of incoming edges to the basic block in the control flow graph, indicating how many other blocks lead to this one.
- Out-degree: The number of outgoing edges from the basic block in the control flow graph, indicating how many other blocks are reachable from this one.
- Static Allocations: The number of static memory allocations made by the basic block.
- Dynamic Allocations: The number of dynamic memory allocations made by the basic block (e.g., using
new
,malloc
). - MemOps (Memory Operations): The number of memory-related operations performed by the basic block (e.g., reads, writes).
- CondBranches (Conditional Branches): The number of conditional branches (e.g., if-else statements) in the basic block.
- UnCondBranches (Unconditional Branches): The number of unconditional branches (e.g., jumps, returns) in the basic block.
- DirectCalls: The number of direct function calls made by the basic block.
- InDirectCalls (Indirect Calls): The number of indirect function calls made by the basic block (e.g., through a pointer or a table).
- VULNERABLE: A binary label indicating whether the basic block is vulnerable (1) or not (0).
A Note on Branches in Basic Blocks
Conditional branches (CondBranches) and unconditional branches (UnCondBranches) primarily serve as sanity checks and do not significantly impact the categorization of Basic Blocks (it might actually harm the accuracy). Let’s analyze the possible values of ( N ) (number of conditional branches) and ( M ) (number of unconditional branches).
A basic block can contain at most one conditional branch. A conditional branch is typically used to terminate the block and transfer control to another location within the code. If there were multiple conditional branches, they would need to be combined into a single decision point using logical operators, which would not increase the count of separate conditional branches.
where ( N ) is either ( 0 ) (no conditional branch) or ( 1 ) (one conditional branch).
Similarly, a basic block can have at most one unconditional branch. An unconditional branch is typically used to exit the block and jump to another location in the code. If there were multiple unconditional branches, they would be redundant, as only one of them would be executed.
where ( M ) is either ( 0 ) (no unconditional branch) or ( 1 ) (one unconditional branch).
If a basic block contains a conditional branch (( N = 1 )), it is not possible to have an unconditional branch (( M = 0 )), as the control flow would be determined solely by the conditional branch. Conversely, if a basic block includes an unconditional branch (( M = 1 )), it is not feasible to have a conditional branch (( N = 0 )), as the unconditional branch would override any conditional decision.
Logically -
That means that only one of ( N ) or ( M ) can have the value of ( 1 ) at any given time. If ( N ) is set to ( 1 ), ( M ) must be set to ( 0 ), and vice versa.
We can use this relationship to check the functionality of our BB compiler pass and sanity of our training dataset.
Cite
If you utilize this project or any portion thereof, please ensure proper citation of the following work:
@misc{upadhyay2024fuzzdistillintelligentfuzzingtarget,
title={FuzzDistill: Intelligent Fuzzing Target Selection using Compile-Time Analysis and Machine Learning},
author={Saket Upadhyay},
year={2024},
eprint={2412.08100},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2412.08100},
}
- Downloads last month
- 61