Commit Graph

53 Commits

Author SHA1 Message Date
jonathanmetzman 4c4b137a70
[cifuzz][external] Use ssh_url and fix affected fuzzers (#5072)
1. Use ssh_url.

This only affects external (non-oss-fuzz) users.
Since there are none, it doesn't affect anyone.
Even if it did, exploitation would require owning the network
Github actions runs on.
This is to prevent MITM attacks.

2. Affected fuzzers bug:
We accidentally were skipping the remove unaffected functionality.
2021-01-29 10:33:36 -08:00
jonathanmetzman f2756d7321
[CIFuzz] Move run_fuzzers to new config system (#5063)
Also, decide is_github based on something not used/faked by Skia.
2021-01-29 09:49:03 +11:00
jonathanmetzman d7e85a20b0
[CIFuzz] Fix diffing + Refactor (#5032)
* [CIFuzz] Fix diffing + Refactor

Make diffing work in two scenarios where it previously failed:
1. Commit fuzzing. In this case, we diff $COMMIT against
$COMMIT^1 because the intent here is to fuzz the commit.
2. Fuzzing PRs that aren't to master. In this case, we previously
were diffing against origin/master. Instead, diff against the local
version of the base repo. This also has the nice effect of handling
PRs that havent pulled from master recently enough.

Also do refactoring.
1. Move code that is different for differenct CI systems to continuous_integration.py
2. Change how configuration in build_fuzzers is handled.
Previously configuration was gotten in build_fuzzers_entrypoint
and passed as individual params. This made code ugly and hard to
read. Instead, move code dealing with config to it's own module
config_utils. This module implements a config class which can
be used to create objects that are passed around to code that needs
it. Making the code much easier to read.
TODO: Move run_fuzzers code to new config system.
2021-01-28 12:10:57 -08:00
jonathanmetzman d6ff0bfcdc
[CIFuzz] Seperate code for running fuzzers into own module: run_fuzzers.py (#5031)
TODO: Rename cifuzz.py to build_fuzzers.py
2021-01-26 08:32:41 -08:00
Jonathan Metzman d7049a82f2 fmt/lnt 2021-01-20 11:40:55 -08:00
Jonathan Metzman cf0c702ee8 fix 2021-01-20 11:33:16 -08:00
Jonathan Metzman 1647e41bef fmt 2021-01-20 10:18:39 -08:00
Jonathan Metzman 9935321c0d fmt/lnt 2021-01-20 07:26:02 -08:00
Jonathan Metzman ddb0add036 fuzzers->fuzz targets and finish affected_fuzz_targets module 2021-01-20 07:25:08 -08:00
Jonathan Metzman 0be9a235b8 merge 2021-01-20 07:02:39 -08:00
Jonathan Metzman 50109305cb New module for affected fuzz targets 2021-01-20 06:56:13 -08:00
Jonathan Metzman cb262dfbcb fmt/lnt 2021-01-20 06:51:30 -08:00
Jonathan Metzman 2ce7db4d47 Refactor coverage and move to own module 2021-01-20 06:47:48 -08:00
jonathanmetzman b9094ea003
[CIFuzz][NFC] Refactor affected fuzzers and improve logging (#5006)
1. Add a get_affected_fuzzers function.
2. Add comments explaining rationales.
3. Fix logging so that each affected fuzzer is only logged once.
4. Don't put each file affecting each fuzzer on its own line, this makes logs unreadable.
5. Improve logging wording.
2021-01-20 06:41:39 -08:00
jonathanmetzman 96b8aad56a
[CIFuzz] Fix MSAN (#4812)
Use msan libs when building fuzzers with MSAN.
2020-12-10 06:24:48 -08:00
Jonathan Metzman ed633664ec fix 2020-12-09 11:47:18 -08:00
jonathanmetzman 265ae85302
[CIFuzz] Fix issue where copied repo is named incorrectly. (#4813)
[CIFuzz] Fix issue where copied repo is named incorrectly.

Make sure the cloned repo is copied correctly to the docker container
E.g. https://github.com/OpenSC/OpenSC should be coiped to $SRC/opensc.

Fixes https://github.com/google/oss-fuzz/issues/4810

Add unittest
2020-12-09 09:55:54 -08:00
jonathanmetzman 301ed831be
Use print for printing stacktrace instead of using log. (#4799)
Use print for printing stacktrace instead of using log.
This makes stacktrace more legible.
Fixes https://github.com/google/oss-fuzz/issues/4649
2020-12-08 09:05:48 -08:00
Jonathan Metzman e193d59148 Revert "Use print for printing stacktrace instead of using log."
This reverts commit ecffb3f662.

Commit should not have been committed to master.
2020-12-07 14:45:47 -08:00
Jonathan Metzman ecffb3f662 Use print for printing stacktrace instead of using log.
This makes stacktrace more legible.

Fixes https://github.com/google/oss-fuzz/issues/4649
2020-12-07 14:42:49 -08:00
jonathanmetzman b0b99d5ccd
Cifuzz external build (#4656)
* Support building fuzzers for projects outside of OSS-Fuzz
* Use retry wrapper
* Fix some tests.
2020-12-07 10:50:11 -08:00
jonathanmetzman c8d2319aa8
[test_all] Rewrite in Python (#4769)
Rewrite test_all in python.
Bash is quite annoying to write and test.
One issue with bash is it is even worse than Python for parallelism (which may be causing #4707).
Rewrite test_all in python and optimize base-runner/Dockerfile for fast development.
Also, combine some docker layers.
2020-12-03 12:52:34 -08:00
jonathanmetzman a43c85a54c [CIFuzz] Set CIFUZZ env var when building/checking/running CIFuzz fuzzers. (#4699)
Fixes https://github.com/google/oss-fuzz/issues/4604
2020-11-24 08:10:05 -08:00
jonathanmetzman 640a9c2bcf
Fix test_all breakage (#4673)
Specify fuzzing language.
Intended to fix https://github.com/google/oss-fuzz/issues/4672
2020-11-20 07:24:06 -08:00
jonathanmetzman f3c0204d10
[NFC][CIFuzz] Fix coding issues. (#4550)
Fix some coding and style issues.
1. Treat "testcase" as one word. This is consistent with ClusterFuzz.
2. Treat "stacktrace" as one word. This is consistent with ClusterFuzz.
3. Fix spelling of comments and words in code.
4. Use descriptive style docstrings and remove unnecessary clutter
(e.g. "Test the functionality of foo_function function in bar module"
becomes "Tests foo_function."
5. Use JSON for a list needed in testing instead of pickle.
2020-11-17 13:39:57 -08:00
jonathanmetzman 8daba1a1a1
[CIFuzz] Don't assume fuzzer output is ASCII (#4537)
[CIFuzz] Don't assume fuzzer output is ascii

This is wrong because the output can be arbitrary. Instead change
code that deals with the output to deal with bytes. The testcase,
which is derived from the output can be decoded as UTF-8 since it
will be a unix path.
2020-10-19 10:10:22 -07:00
jonathanmetzman 571dbfb39f
Reland 55d9a81. (#4269)
The issue with 55d9a81 that caused it to be reverted by 3370f8f
was probably due to the build trigger on GCB being stale. I've
updated it so this commit should stick.
2020-08-06 14:33:08 -07:00
Evgeny Vereshchagin 3370f8f7e5
Revert "[CIFuzz] Allow supplying a manual source checkout (#4250)" (#4263)
This reverts commit 55d9a81cd7.

Closes https://github.com/google/oss-fuzz/issues/4262
2020-08-06 06:11:59 -07:00
jonathanmetzman 55d9a81cd7
[CIFuzz] Allow supplying a manual source checkout (#4250)
Make CIFuzz building accept an env var `MANUAL_SRC_PATH` that points to a manually prepared checkout of the project-under-tests's source code. This allows projects like Skia which are not on OSS-Fuzz and/or need to make changes to the repo after checking out the right commit to use CIFuzz.
Note that for now we aren't supporting this in GitHub, so projects that need to modify the source after checkout can't use it until
we do support it.

Also, use the local copy of OSS-Fuzz when building cifuzz-base instead of cloning it from GitHub. This makes local debugging/development much easier since it allows one to use CIFuzz with local changes.
2020-08-05 18:45:12 -07:00
Abhishek Arya 21ea9d6e3d
Remove sanitizer validation checks in CIFuzz, (#4131)
Sanitizer validation is not needed and it is hacky code with
no proper yaml parsing. sanitizer attribute is properly
documented.
Fixes #3996.
2020-07-15 13:00:57 -07:00
jonathanmetzman cac6118315
[cifuzz] Temporary fix for sanitizer validation. (#3997)
Temporary fix for sanitizer validation.

Our sanitizer validation is hacky and isn't using pyyaml to actually
parse the project.yaml file. Temporarily work around #3996 by not
validating sanitizers if no sanitizers are specified in project.yaml.
2020-06-17 10:32:42 -07:00
Evgeny Vereshchagin 26e8d7c772
[CIFuzz] Add support for different sanitizers (#3969)
* Revert "Revert "[CIFuzz] Add support for different sanitizers (#3516)""

This reverts commit c580d0d626.

* cifuzz: pass "sanitizer" to the "run fuzzer" step

It's a follow-up to https://github.com/google/oss-fuzz/pull/3516 that
should fix https://github.com/google/oss-fuzz/issues/3727.

* [cifuzz] drop a $

That's another follow-up to #3516 that should help to pass sanitizer correctly.
Otherwise, it always falls back to address with:

2020-06-11 21:10:14,852 - root - INFO - $address is not a project sanitizer, defaulting to address.
2020-06-11 18:27:01 -07:00
Abhishek Arya 8d5aef84db
Use hardcoded FUZZING_LANGUAGE to unbreak CIFuzz. (#3844) 2020-05-18 08:23:28 -07:00
jonathanmetzman 1f533163cc
[CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE (#3726)
Currently we use Github action's inputs as inputs to cifuzz.
This means we need to do an extra step to convert each input into
an env var so our scripts can actually use it.
This is pretty bug prone and unnecessary, we should probably
get rid of this abstraction and switch to encouraging devs to set
the env vars directly.
2020-05-13 12:44:11 -07:00
Jonathan Metzman c580d0d626 Revert "[CIFuzz] Add support for different sanitizers (#3516)"
This reverts commit 9b30127675.
2020-04-28 14:38:10 -07:00
Jonathan Metzman dac83d7b8e Revert "[CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE"
This reverts commit 6f1a7f7911.
2020-04-28 13:37:58 -07:00
Jonathan Metzman 6f1a7f7911 [CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE 2020-04-28 13:36:21 -07:00
Leo Neat 9b30127675
[CIFuzz] Add support for different sanitizers (#3516) 2020-04-28 12:31:36 -07:00
Leo Neat 9d52175ca0
Affected fuzzer fix (#3510)
Fix bug in affected fuzzer caused by miss matched naming. The git diff was returning file paths relative to the root of the project and the coverage files was returning file paths relative to one directory above the project directory.
2020-03-16 12:02:16 -07:00
Leo Neat a1c7499830
[CIFuzz] Logging updates (#3503)
Provide some simple logging updates to assert that affected fuzzers is running correctly.
Also prevents the clouding of longs when the reproduction script runs.
2020-03-16 10:00:56 -07:00
Leo Neat 6f02735d0c
[CIFuzz] Dynamic fuzzer scheduling (#3453)
Allocates time for fuzzers based on amount of fuzzing time left. This is beneficial when a fuzzer fails early in its allotted time because of a reproducible OSS-Fuzz bug. It will then give the remaining portion of its allotted time to the following fuzzers.
2020-03-13 10:35:33 -07:00
Leo Neat b6a1d4dcb1
Revert "Revert "[CIFuzz] Affected fuzzers (#3450)" (#3488)" (#3496)
This reverts commit e58ee49e20.
2020-03-12 13:51:33 -07:00
Leo Neat b0cd13e3bb
Affected fuzzer fix (#3494)
Fixing json decode error with affected fuzzer functionality.
2020-03-12 12:01:57 -07:00
Leo Neat e58ee49e20
Revert "[CIFuzz] Affected fuzzers (#3450)" (#3488)
This reverts commit e8ebda10ee.
2020-03-10 15:59:43 -07:00
Leo Neat e8ebda10ee
[CIFuzz] Affected fuzzers (#3450)
Add feature to only run fuzzers that are affected by the code change. This change prevents valuable time being wasted on fuzzing unchanged code.
2020-03-10 13:22:11 -07:00
Leo Neat 5869bb7341
[CIFuzz] Download code coverage (#3434)
This is the foundation for affected fuzzers. It provides the ability to map fuzzers to files. In the future we will use this functionality to pick which fuzzers to run during CI.
2020-03-05 11:22:44 -08:00
Leo Neat 12a2e86d46
[CIFuzz] Check fuzzers (#3419)
Checks that the fuzzer build was a success in the build action.
2020-02-27 08:54:52 -08:00
Leo Neat 39fe0d725b
[CIFuzz] Check crash on most recent OSS-Fuzz build (#3385)
Adds functionality to check if a crash exists in the most recent OSS-Fuzz build. This is necessary to determine if a crash was introduced in the current pull request or existed in the project already.  Crashes that are surfaced to the user will be both reproducible and novel to the OSS-Fuzz project.
2020-02-19 15:32:30 -08:00
Leo Neat 0ed0f37ca2
[CIFuzz] Change 'bug_report' directory to 'artifacts'. (#3369) 2020-02-11 08:42:10 -08:00
Leo Neat ffc6af6d1d
[CIFuzz] Add parse fuzzer output functionality (#3342) 2020-02-10 10:00:54 -08:00