-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rust] Initial implementation for Rust
Signed-off-by: Arthur Chan <[email protected]>
- Loading branch information
1 parent
9472a76
commit 43792da
Showing
8 changed files
with
177 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
You are a security testing engineer who wants to write a Rust program to execute all lines in a given method by defining and initialising its parameters and necessary objects in a suitable way before fuzzing the method. | ||
The <target> tag contains information of the target method to invoke. | ||
The <requirements> tag contains additional requirements that you MUST follow for this code generation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<task> | ||
Your goal is to write a fuzzing harness for the provided method signature to fuzz the method with random data. It is important that the provided solution compiles and actually calls the function specified by the method signature: | ||
<target> | ||
<function_signature> | ||
{FUNCTION_SIGNATURE} | ||
</function_signature> | ||
The target function is belonging to the Rust project {PROJECT_NAME} ({PROJECT_URL}). | ||
This function requires {ARG_COUNT} arguments. You must prepare them with random seeded data. | ||
Here is a list of types for all arguments in order, separated by comma. You MUST preserve the modifiers. | ||
{ARG_TYPE} | ||
</target> | ||
<requirements> | ||
<item>Try as many variations of these inputs as possible.</item> | ||
<item>Try creating the harness as complex as possible.</item> | ||
<item>Try adding some nested loop to invoke the target method for multiple times.</item> | ||
<item>The generated fuzzing harness should be wrapped with the <code> tag.</item> | ||
<item>Please avoid using any multithreading or multi-processing approach.</item> | ||
<item>You MUST create the fuzzing harness using Cargo-Fuzz approach.</item> | ||
<item>you MUST use the #![no_main] tag.</item> | ||
<item>You MUST use the libfuzzer_sys::fuzz_target crate.</item> | ||
<item>You MUST include the fuzz_target macro to include all fuzzing statements.</item> | ||
<item>The following is a sample of the fuzzing harness. | ||
<code> | ||
#![no_main] | ||
use libfuzzer_sys::fuzz_target; | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
// This is the macro acts as the entry point for the fuzzing harness. | ||
// Add fuzzing logic here. | ||
}); | ||
</code></item> | ||
</requirements> | ||
</task> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters