Skip to content

Commit f890063

Browse files
Add an 'OSS-Fuzz for CPython' overview (#1801)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 2a14b3a commit f890063

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

testing/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ Testing and buildbots
1010
run-write-tests
1111
silence-warnings
1212
coverage
13+
oss-fuzz
1314
buildbots
1415
new-buildbot-worker

testing/oss-fuzz.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
OSS-Fuzz for CPython
2+
====================
3+
4+
CPython uses `OSS-Fuzz <https://google.github.io/oss-fuzz/>`__, Google's
5+
continuous fuzzing service for open-source projects, to find bugs and
6+
security vulnerabilities by feeding semi-random data to various APIs.
7+
8+
CPython has two OSS-Fuzz projects:
9+
10+
* `cpython3 <https://github.com/google/oss-fuzz/tree/master/projects/cpython3>`__:
11+
The fuzz targets, seed corpora, and dictionaries can be found in the
12+
:cpy-file:`Modules/_xxtestfuzz/` directory of CPython. This project
13+
is maintained for existing fuzz targets; add new targets to
14+
``python3-libraries``.
15+
16+
* `python3-libraries <https://github.com/google/oss-fuzz/tree/master/projects/python3-libraries>`__:
17+
The fuzz targets, seed corpora, and dictionaries can be found in the
18+
:github:`python/library-fuzzers` repository. Access to the repository is
19+
managed through the `@python/fuzzers
20+
<https://github.com/orgs/python/teams/fuzzers>`__ team on GitHub.
21+
22+
OSS-Fuzz bug reports are private when filed, so access to crash details and
23+
reproducer test cases is limited to those listed in the ``auto_ccs`` fields of
24+
the OSS-Fuzz project configuration files. Those listed can log into
25+
https://oss-fuzz.com/ with their Google account to view crash details,
26+
reproducer test cases, and project statistics.
27+
If you need access, contact the ``@python/fuzzers`` team.
28+
Completed issues, and issues that remain unresolved after 90 days, are publicly
29+
visible in the `OSS-Fuzz issue tracker
30+
<https://issues.oss-fuzz.com/issues?q=(python3-libraries%20%7C%20cpython3)>`__.
31+
32+
Coverage and target statistics are available in the OSS-Fuzz Introspector
33+
project profiles for `cpython3 <https://introspector.oss-fuzz.com/project-profile?project=cpython3>`__ and
34+
`python3-libraries <https://introspector.oss-fuzz.com/project-profile?project=python3-libraries>`__.
35+
36+
In addition, `CIFuzz <https://google.github.io/oss-fuzz/getting-started/continuous-integration/>`__
37+
runs the fuzz targets on GitHub Actions for PRs to the ``main`` branch changing
38+
relevant files.
39+
40+
.. seealso::
41+
42+
The `libFuzzer <https://llvm.org/docs/LibFuzzer.html>`__ documentation for
43+
details about the fuzzing engine used by OSS-Fuzz.
44+
45+
46+
Adding new targets
47+
------------------
48+
49+
Add new targets to the ``python3-libraries`` project. For more
50+
information, see the documentation in the :github:`python/library-fuzzers`
51+
repository.
52+
53+
If the new target covers a standard library module, update the relevant CIFuzz
54+
path configuration so pull requests touching that module trigger fuzzing. See
55+
the ``LIBRARY_FUZZER_PATHS`` set in :cpy-file:`Tools/build/compute-changes.py`.

0 commit comments

Comments
 (0)