Skip to content

Commit

Permalink
Upstream Serenity support
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin authored and carl-smith committed Jan 5, 2024
1 parent 593e570 commit 98085bc
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/FuzzilliCli/Profiles/Profile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ let profiles = [
"jerryscript": jerryscriptProfile,
"xs": xsProfile,
"v8holefuzzing": v8HoleFuzzingProfile,
"serenity": serenityProfile,
]
42 changes: 42 additions & 0 deletions Sources/FuzzilliCli/Profiles/Serenity.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import Fuzzilli

let serenityProfile = Profile(
processArguments: [""],
processEnv: [
"UBSAN_OPTIONS":"handle_segv=0 handle_abrt=0",
"ASAN_OPTIONS":"abort_on_error=1"
],
maxExecsBeforeRespawn: 1000,
timeout: 250,
codePrefix: ""
codeSuffix: ""
ecmaVersion: ECMAScriptVersion.es6,
crashTests: ["fuzzilli('FUZZILLI_CRASH', 0)", "fuzzilli('FUZZILLI_CRASH', 1)"],
additionalCodeGenerators: WeightedList<CodeGenerator>([]),
additionalProgramTemplates: WeightedList<ProgramTemplate>([]),
disabledCodeGenerators: [],
disabledMutators: [],
additionalBuiltins: [
"gc" : .function([] => .undefined)
]
optionalPostProcessor: nil
)
5 changes: 5 additions & 0 deletions Targets/Serenity/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To build Serenity's javascript engine for fuzzing,
follow its [documentation](https://github.com/SerenityOS/serenity/blob/master/Meta/Lagom/ReadMe.md#fuzzing),
no patching is necessary.

The fuzzing harness will be `Build/Meta/Lagom/Fuzzers/FuzzilliJs`.

0 comments on commit 98085bc

Please sign in to comment.