forked from google/oss-fuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Following the addition of some fuzzing tests ([#1](u-root/u-root#2528), [#2](u-root/u-root#2535), [#3](u-root/u-root#2536)) in the u-root project and [preparations for this integration](u-root/u-root#2543). You can check out its [website](https://u-root.org/) for more info on the project. Signed-off-by: Fabian Wienand <[email protected]> Signed-off-by: Fabian Wienand <[email protected]>
- Loading branch information
Showing
3 changed files
with
112 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2022 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 | ||
# | ||
# http://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. | ||
# | ||
################################################################################ | ||
|
||
FROM gcr.io/oss-fuzz-base/base-builder-go | ||
RUN git clone --depth 1 https://github.com/u-root/u-root | ||
WORKDIR u-root | ||
COPY build.sh $SRC/ |
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,80 @@ | ||
#!/bin/bash -eu | ||
# Copyright 2022 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 | ||
# | ||
# http://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. | ||
# | ||
################################################################################ | ||
|
||
# cpio pkg | ||
cd $SRC/u-root/pkg/cpio | ||
go mod init cpio | ||
go mod tidy | ||
go install github.com/AdamKorcz/go-118-fuzz-build@latest | ||
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes | ||
go get github.com/AdamKorcz/go-118-fuzz-build/utils | ||
|
||
cp $SRC/u-root/pkg/cpio/testdata/fuzz/*.dict $SRC/u-root/pkg/cpio/testdata/fuzz/*.options $OUT | ||
|
||
## FuzzReadWriteNewc | ||
zip -j $OUT/fuzz_read_write_newc_seed_corpus.zip $SRC/u-root/pkg/cpio/testdata/fuzz/corpora/* | ||
compile_native_go_fuzzer $SRC/u-root/pkg/cpio FuzzReadWriteNewc fuzz_read_write_newc | ||
|
||
## FuzzWriteReadInMemArchive | ||
compile_native_go_fuzzer $SRC/u-root/pkg/cpio FuzzWriteReadInMemArchive fuzz_write_read_in_mem_archive | ||
|
||
# grub pkg | ||
cd $SRC/u-root/pkg/boot/grub | ||
go mod init grub | ||
go mod tidy | ||
go install github.com/AdamKorcz/go-118-fuzz-build@latest | ||
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes | ||
go get github.com/AdamKorcz/go-118-fuzz-build/utils | ||
|
||
cp $SRC/u-root/pkg/boot/grub/testdata/fuzz/*.dict $SRC/u-root/pkg/boot/grub/testdata/fuzz/*.options $OUT | ||
|
||
## FuzzParseEnvFile | ||
compile_native_go_fuzzer $SRC/u-root/pkg/boot/grub FuzzParseEnvFile fuzz_parse_env_file | ||
|
||
## FuzzParseGrubConfig | ||
find $SRC/u-root/pkg/boot/grub/testdata_new -name "grub.cfg" -exec zip $OUT/fuzz_parse_grub_config_seed_corpus.zip {} + | ||
compile_native_go_fuzzer $SRC/u-root/pkg/boot/grub FuzzParseGrubConfig fuzz_parse_grub_config | ||
|
||
# localboot pkg | ||
cd $SRC/u-root/cmds/boot/localboot | ||
go mod init localboot | ||
go mod tidy | ||
go install github.com/AdamKorcz/go-118-fuzz-build@latest | ||
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes | ||
go get github.com/AdamKorcz/go-118-fuzz-build/utils | ||
|
||
cp $SRC/u-root/pkg/boot/grub/testdata/fuzz/*.dict $SRC/u-root/cmds/boot/localboot/testdata/fuzz/*.options $OUT | ||
|
||
## FuzzParseGrubCfg | ||
find $SRC/u-root/pkg/boot/grub/testdata_new -name "grub.cfg" -exec zip $OUT/fuzz_parse_grub_cfg_seed_corpus.zip {} + | ||
|
||
compile_native_go_fuzzer $SRC/u-root/cmds/boot/localboot FuzzParseGrubCfg fuzz_parse_grub_cmd_cfg | ||
|
||
# syslinux pkg | ||
cd $SRC/u-root/pkg/boot/syslinux | ||
go mod init syslinux | ||
go mod tidy | ||
go install github.com/AdamKorcz/go-118-fuzz-build@latest | ||
go get github.com/AdamKorcz/go-118-fuzz-build/testingtypes | ||
go get github.com/AdamKorcz/go-118-fuzz-build/utils | ||
|
||
cp $SRC/u-root/pkg/boot/syslinux/testdata/fuzz/*.dict $SRC/u-root/pkg/boot/syslinux/testdata/fuzz/*.options $OUT | ||
|
||
## FuzzParseSyslinuxConfig | ||
find $SRC/u-root/pkg/boot/syslinux/testdata -name "isolinux.cfg" -exec zip $OUT/fuzz_parse_syslinux_config_seed_corpus.zip {} + | ||
|
||
compile_native_go_fuzzer $SRC/u-root/pkg/boot/syslinux FuzzParseSyslinuxConfig fuzz_parse_syslinux_config |
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,12 @@ | ||
homepage: "https://u-root.org/" | ||
main_repo: "https://github.com/u-root/u-root.git" | ||
primary_contact: "[email protected]" | ||
auto_ccs: | ||
- "[email protected]" | ||
language: go | ||
architectures: | ||
- x86_64 | ||
fuzzing_engines: | ||
- libfuzzer | ||
sanitizers: | ||
- address |