1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 02:27:35 +00:00
serenity/Meta/Lagom/Fuzzers/add-serenity-support-to-fuzzilli.patch
Luke 8928607455 Lagom/Fuzzers: Add Fuzzilli version of FuzzJs
Fuzzilli is a JavaScript engine fuzzer made by googleprojectzero.

https://github.com/googleprojectzero/fuzzilli/
2020-11-07 10:09:55 +01:00

44 lines
1.1 KiB
Diff

diff --git a/Sources/FuzzilliCli/Profiles/Profile.swift b/Sources/FuzzilliCli/Profiles/Profile.swift
index 6d8a795..a506d41 100644
--- a/Sources/FuzzilliCli/Profiles/Profile.swift
+++ b/Sources/FuzzilliCli/Profiles/Profile.swift
@@ -32,6 +32,33 @@ struct Profile {
let additionalBuiltins: [String: Type]
}
+let serenityProfile = Profile(
+ processArguments: [""],
+
+ processEnv: ["UBSAN_OPTIONS":"handle_segv=0 handle_abrt=0"],
+
+ codePrefix: """
+ function main() {
+ """,
+
+ codeSuffix: """
+ }
+ main();
+ """,
+
+ ecmaVersion: ECMAScriptVersion.es6,
+
+ crashTests: ["fuzzilli('FUZZILLI_CRASH', 0)", "fuzzilli('FUZZILLI_CRASH', 1)"],
+
+ additionalCodeGenerators: WeightedList<CodeGenerator>([]),
+
+ disabledCodeGenerators: [],
+
+ additionalBuiltins: [
+ "gc" : .function([] => .undefined)
+ ]
+)
+
let profiles = [
"qjs": qjsProfile,
"jsc": jscProfile,
@@ -39,4 +66,5 @@ let profiles = [
"v8": v8Profile,
"duktape": duktapeProfile,
"jerryscript": jerryscriptProfile,
+ "serenity": serenityProfile,
]