Add files using upload-large-folder tool
Browse files- local-test-tika-delta-01/fuzz-tooling/.dockerignore +14 -0
- local-test-tika-delta-01/fuzz-tooling/.gitignore +12 -0
- local-test-tika-delta-01/fuzz-tooling/CITATION.cff +46 -0
- local-test-tika-delta-01/fuzz-tooling/CONTRIBUTING.md +26 -0
- local-test-tika-delta-01/fuzz-tooling/LICENSE +201 -0
- local-test-tika-delta-01/fuzz-tooling/README.md +135 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/ansible-runner-cve-2021-4041/build.sh +25 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/ansible-runner-cve-2021-4041/fuzz_ansible_runner.py +64 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/libvcs-cve-2022-21187/build.sh +21 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/libvcs-cve-2022-21187/fuzz_libvcs.py +45 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/yaml_deserialization_general.py +47 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/convertcorpus/go.mod +10 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/convertcorpus/go.sum +24 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/convertcorpus/main.go +54 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/go.mod +8 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/go.sum +30 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/gocovmerge/gocovmerge.go +111 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/gocovsum/gocovsum.go +171 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/pprof-merge/LICENSE +201 -0
- local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/pprof-merge/main.go +68 -0
local-test-tika-delta-01/fuzz-tooling/.dockerignore
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
.venv
|
| 3 |
+
infra/cifuzz/test_data/*
|
| 4 |
+
docs/*
|
| 5 |
+
|
| 6 |
+
# Copied from .gitignore.
|
| 7 |
+
.vscode/
|
| 8 |
+
*.pyc
|
| 9 |
+
build
|
| 10 |
+
*~
|
| 11 |
+
.DS_Store
|
| 12 |
+
*.swp
|
| 13 |
+
.pytest_cache
|
| 14 |
+
*__pycache__/*
|
local-test-tika-delta-01/fuzz-tooling/.gitignore
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/.vscode/
|
| 2 |
+
*.pyc
|
| 3 |
+
/build/
|
| 4 |
+
*~
|
| 5 |
+
.DS_Store
|
| 6 |
+
*.swp
|
| 7 |
+
.venv
|
| 8 |
+
.gdb_history
|
| 9 |
+
|
| 10 |
+
# IntelliJ IDEA
|
| 11 |
+
/.idea
|
| 12 |
+
**/*.iml
|
local-test-tika-delta-01/fuzz-tooling/CITATION.cff
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cff-version: 1.2.0
|
| 2 |
+
title: OSS-Fuzz
|
| 3 |
+
message: >-
|
| 4 |
+
If you use this software, please cite it using the
|
| 5 |
+
metadata from this file.
|
| 6 |
+
type: software
|
| 7 |
+
authors:
|
| 8 |
+
- given-names: Abhishek
|
| 9 |
+
family-names: Arya
|
| 10 |
+
affiliation: Google LLC
|
| 11 |
+
email: aarya@google.com
|
| 12 |
+
orcid: 'https://orcid.org/0009-0009-4558-4314'
|
| 13 |
+
- given-names: Oliver
|
| 14 |
+
family-names: Chang
|
| 15 |
+
email: ochang@google.com
|
| 16 |
+
affiliation: Google LLC
|
| 17 |
+
orcid: 'https://orcid.org/0009-0006-3181-4551'
|
| 18 |
+
- given-names: Jonathan
|
| 19 |
+
family-names: Metzman
|
| 20 |
+
email: metzman@google.com
|
| 21 |
+
affiliation: Google LLC
|
| 22 |
+
orcid: 'https://orcid.org/0000-0002-7042-0444'
|
| 23 |
+
- given-names: Kostya
|
| 24 |
+
family-names: Serebryany
|
| 25 |
+
email: kcc@google.com
|
| 26 |
+
affiliation: Google LLC
|
| 27 |
+
orcid: 'https://orcid.org/0009-0009-2379-3641'
|
| 28 |
+
- given-names: Dongge
|
| 29 |
+
family-names: Liu
|
| 30 |
+
email: donggeliu@google.com
|
| 31 |
+
affiliation: Google LLC
|
| 32 |
+
orcid: 'https://orcid.org/0000-0003-4821-7033'
|
| 33 |
+
repository-code: 'https://github.com/google/oss-fuzz'
|
| 34 |
+
abstract: >-
|
| 35 |
+
OSS-Fuzz is an open-source project by Google that provides
|
| 36 |
+
continuous fuzzing for open-source software. It aims to
|
| 37 |
+
make common open-source software more secure and stable by
|
| 38 |
+
combining modern fuzzing techniques with scalable,
|
| 39 |
+
distributed execution. As of August 2023, OSS-Fuzz has
|
| 40 |
+
helped identify and fix over 10,000 vulnerabilities and
|
| 41 |
+
36,000 bugs across 1,000 projects.
|
| 42 |
+
keywords:
|
| 43 |
+
- open-source
|
| 44 |
+
- fuzzing
|
| 45 |
+
license: Apache-2.0
|
| 46 |
+
|
local-test-tika-delta-01/fuzz-tooling/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Want to contribute? Great! First, read this page (including the small print at
|
| 2 |
+
the end).
|
| 3 |
+
|
| 4 |
+
### Before you contribute
|
| 5 |
+
Before we can use your code, you must sign the
|
| 6 |
+
[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual)
|
| 7 |
+
(CLA), which you can do online. The CLA is necessary mainly because you own the
|
| 8 |
+
copyright to your changes, even after your contribution becomes part of our
|
| 9 |
+
codebase, so we need your permission to use and distribute your code. We also
|
| 10 |
+
need to be sure of various other things: for instance that you'll tell us if you
|
| 11 |
+
know that your code infringes on other people's patents. You don't have to sign
|
| 12 |
+
the CLA until after you've submitted your code for review and a member has
|
| 13 |
+
approved it, but you must do it before we can put your code into our codebase.
|
| 14 |
+
Before you start working on a larger contribution, you should get in touch with
|
| 15 |
+
us first through the issue tracker with your idea so that we can help out and
|
| 16 |
+
possibly guide you. Coordinating up front makes it much easier to avoid
|
| 17 |
+
frustration later on.
|
| 18 |
+
|
| 19 |
+
### Code reviews
|
| 20 |
+
All submissions, including submissions by project members, require review. We
|
| 21 |
+
use GitHub pull requests for this purpose.
|
| 22 |
+
|
| 23 |
+
### The small print
|
| 24 |
+
Contributions made by corporations are covered by a different agreement than
|
| 25 |
+
the one above, the
|
| 26 |
+
[Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate).
|
local-test-tika-delta-01/fuzz-tooling/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright {yyyy} {name of copyright owner}
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
local-test-tika-delta-01/fuzz-tooling/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OSS-Fuzz-AIxCC: AIxCC AFC Competition fork of OSS-Fuzz (v1.2.0)
|
| 2 |
+
|
| 3 |
+
Changes in v1.2.0:
|
| 4 |
+
|
| 5 |
+
- `base-builder-jvm` has been updated to use the lastest aixcc-jazzer ref, adjusting the OsCmdInjection sanitizer.
|
| 6 |
+
- This adjustment adds some safety measures around OsCmdInjection to reduce risk and reduce potential
|
| 7 |
+
unintentional crash-state explosion when dealing with such vulnerabilities.
|
| 8 |
+
- `helper.py` commands `build_image`, `build_fuzzers`, and `shell` have added optional flags to control docker image tags.
|
| 9 |
+
- Adds the flag `--docker_image_tag TAG` to the commands. This is entirely optional and backwards
|
| 10 |
+
compatible, but can allow control over the project-image docker tag, enabling easier parallel processing.
|
| 11 |
+
- `helper.py reproduce` has an added optional flag to reproduce with docker running in non-privileged mode.
|
| 12 |
+
- `helper.py reproduce` has an added optional flag to timeout when the reproduce subprocess hangs.
|
| 13 |
+
- This enables crash detection to handle cases where sanitizers are hit, yet for various reasons the
|
| 14 |
+
reproduce subprocess does not resolve and hangs indefinitely. If `timeout` is set, when the reproduce
|
| 15 |
+
subprocess does not resolve within `timeout` seconds, reproduce will end the subprocess and return with code 124.
|
| 16 |
+
|
| 17 |
+
Changes in v1.1.0:
|
| 18 |
+
|
| 19 |
+
- The state of oss-fuzz-aixcc has been synced with upstream changes at 162f2ab818f5992b66486a4d06cb0e3c88c37773.
|
| 20 |
+
- `helper.py build_fuzzers` with local source now matches behavior of non-local source, keeping the build state clean between runs.
|
| 21 |
+
- `base-image` has been updated to default its locale to C.UTF-8 instead of POSIX.
|
| 22 |
+
|
| 23 |
+
This is a competition fork of oss-fuzz which is guaranteed to be
|
| 24 |
+
compatible with the AFC challenges. This fork is designed to remain
|
| 25 |
+
fully backwards compatible with the public/upstream oss-fuzz, and
|
| 26 |
+
thus competition challenges will reflect realistic real-world repositories.
|
| 27 |
+
|
| 28 |
+
***Other than base-image changes, the projects files have not been touched
|
| 29 |
+
in this repository. The list of projects in the projects directory does
|
| 30 |
+
not reflect which projects will be used in any AFC round.***
|
| 31 |
+
|
| 32 |
+
Competitors are recommended to test their CRS against public repositories using this competition fork.
|
| 33 |
+
Competitors are recommended to view the [example-crs-architecture] repository's
|
| 34 |
+
[example-challenge-evaluation] scripts to see details on how this fuzz tooling is used during competition.
|
| 35 |
+
|
| 36 |
+
[example-crs-arhictecture]: https://github.com/aixcc-finals/example-crs-architecture
|
| 37 |
+
[example-challenge-evaluation]: https://github.com/aixcc-finals/example-crs-architecture/tree/main/example-challenge-evaluation
|
| 38 |
+
|
| 39 |
+
Example basic usage of the helper script is below. **Note: When working with local source, you must pass the local
|
| 40 |
+
source repository into the scripts as detailed below.**
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
# Build the project image and pull AFC base images
|
| 44 |
+
infra/helper.py build_image --pull <project_name>
|
| 45 |
+
|
| 46 |
+
# Build the fuzzer harnesses for the project, using local source
|
| 47 |
+
infra/helper.py build_fuzzers --clean --sanitizer <sanitizer> --engine <engine> <project_name> <path-to-local-src>
|
| 48 |
+
|
| 49 |
+
# Check all fuzzer harnesses for build
|
| 50 |
+
infra/helper.py check_build --sanitizer <sanitizer> --engine <engine> <project_name>
|
| 51 |
+
|
| 52 |
+
# Reproduce the testcase
|
| 53 |
+
# optionally use --propagate_exit_codes
|
| 54 |
+
infra/helper.py reproduce <project_name> <harness_name> <path-to-data-blob>
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
# OSS-Fuzz: Continuous Fuzzing for Open Source Software
|
| 60 |
+
|
| 61 |
+
[Fuzz testing] is a well-known technique for uncovering programming errors in
|
| 62 |
+
software. Many of these detectable errors, like [buffer overflow], can have
|
| 63 |
+
serious security implications. Google has found [thousands] of security
|
| 64 |
+
vulnerabilities and stability bugs by deploying [guided in-process fuzzing of
|
| 65 |
+
Chrome components], and we now want to share that service with the open source
|
| 66 |
+
community.
|
| 67 |
+
|
| 68 |
+
[Fuzz testing]: https://en.wikipedia.org/wiki/Fuzz_testing
|
| 69 |
+
[buffer overflow]: https://en.wikipedia.org/wiki/Buffer_overflow
|
| 70 |
+
[thousands]: https://issues.chromium.org/issues?q=label:Stability-LibFuzzer%20-status:Duplicate,WontFix
|
| 71 |
+
[guided in-process fuzzing of Chrome components]: https://security.googleblog.com/2016/08/guided-in-process-fuzzing-of-chrome.html
|
| 72 |
+
|
| 73 |
+
In cooperation with the [Core Infrastructure Initiative] and the [OpenSSF],
|
| 74 |
+
OSS-Fuzz aims to make common open source software more secure and stable by
|
| 75 |
+
combining modern fuzzing techniques with scalable, distributed execution.
|
| 76 |
+
Projects that do not qualify for OSS-Fuzz (e.g. closed source) can run their own
|
| 77 |
+
instances of [ClusterFuzz] or [ClusterFuzzLite].
|
| 78 |
+
|
| 79 |
+
[Core Infrastructure Initiative]: https://www.coreinfrastructure.org/
|
| 80 |
+
[OpenSSF]: https://www.openssf.org/
|
| 81 |
+
|
| 82 |
+
We support the [libFuzzer], [AFL++], and [Honggfuzz] fuzzing engines in
|
| 83 |
+
combination with [Sanitizers], as well as [ClusterFuzz], a distributed fuzzer
|
| 84 |
+
execution environment and reporting tool.
|
| 85 |
+
|
| 86 |
+
[libFuzzer]: https://llvm.org/docs/LibFuzzer.html
|
| 87 |
+
[AFL++]: https://github.com/AFLplusplus/AFLplusplus
|
| 88 |
+
[Honggfuzz]: https://github.com/google/honggfuzz
|
| 89 |
+
[Sanitizers]: https://github.com/google/sanitizers
|
| 90 |
+
[ClusterFuzz]: https://github.com/google/clusterfuzz
|
| 91 |
+
[ClusterFuzzLite]: https://google.github.io/clusterfuzzlite/
|
| 92 |
+
|
| 93 |
+
Currently, OSS-Fuzz supports C/C++, Rust, Go, Python, Java/JVM, and JavaScript code. Other languages
|
| 94 |
+
supported by [LLVM] may work too. OSS-Fuzz supports fuzzing x86_64 and i386
|
| 95 |
+
builds.
|
| 96 |
+
|
| 97 |
+
[LLVM]: https://llvm.org
|
| 98 |
+
|
| 99 |
+
## Overview
|
| 100 |
+

|
| 101 |
+
|
| 102 |
+
## Documentation
|
| 103 |
+
Read our [detailed documentation] to learn how to use OSS-Fuzz.
|
| 104 |
+
|
| 105 |
+
[detailed documentation]: https://google.github.io/oss-fuzz
|
| 106 |
+
|
| 107 |
+
## Trophies
|
| 108 |
+
As of August 2023, OSS-Fuzz has helped identify and fix over [10,000] vulnerabilities and [36,000] bugs across [1,000] projects.
|
| 109 |
+
|
| 110 |
+
[10,000]: https://bugs.chromium.org/p/oss-fuzz/issues/list?q=Type%3DBug-Security%20label%3Aclusterfuzz%20-status%3ADuplicate%2CWontFix&can=1
|
| 111 |
+
[36,000]: https://bugs.chromium.org/p/oss-fuzz/issues/list?q=Type%3DBug%20label%3Aclusterfuzz%20-status%3ADuplicate%2CWontFix&can=1
|
| 112 |
+
[1,000]: https://github.com/google/oss-fuzz/tree/master/projects
|
| 113 |
+
|
| 114 |
+
## Blog posts
|
| 115 |
+
* 2023-08-16 - [AI-Powered Fuzzing: Breaking the Bug Hunting Barrier]
|
| 116 |
+
* 2023-02-01 - [Taking the next step: OSS-Fuzz in 2023]
|
| 117 |
+
* 2022-09-08 - [Fuzzing beyond memory corruption: Finding broader classes of vulnerabilities automatically]
|
| 118 |
+
* 2021-12-16 - [Improving OSS-Fuzz and Jazzer to catch Log4Shell]
|
| 119 |
+
* 2021-03-10 - [Fuzzing Java in OSS-Fuzz]
|
| 120 |
+
* 2020-12-07 - [Improving open source security during the Google summer internship program]
|
| 121 |
+
* 2020-10-09 - [Fuzzing internships for Open Source Software]
|
| 122 |
+
* 2018-11-06 - [A New Chapter for OSS-Fuzz]
|
| 123 |
+
* 2017-05-08 - [OSS-Fuzz: Five months later, and rewarding projects]
|
| 124 |
+
* 2016-12-01 - [Announcing OSS-Fuzz: Continuous fuzzing for open source software]
|
| 125 |
+
|
| 126 |
+
[AI-Powered Fuzzing: Breaking the Bug Hunting Barrier]: https://security.googleblog.com/2023/08/ai-powered-fuzzing-breaking-bug-hunting.html
|
| 127 |
+
[Announcing OSS-Fuzz: Continuous fuzzing for open source software]: https://opensource.googleblog.com/2016/12/announcing-oss-fuzz-continuous-fuzzing.html
|
| 128 |
+
[OSS-Fuzz: Five months later, and rewarding projects]: https://opensource.googleblog.com/2017/05/oss-fuzz-five-months-later-and.html
|
| 129 |
+
[A New Chapter for OSS-Fuzz]: https://security.googleblog.com/2018/11/a-new-chapter-for-oss-fuzz.html
|
| 130 |
+
[Fuzzing internships for Open Source Software]: https://security.googleblog.com/2020/10/fuzzing-internships-for-open-source.html
|
| 131 |
+
[Improving open source security during the Google summer internship program]: https://security.googleblog.com/2020/12/improving-open-source-security-during.html
|
| 132 |
+
[Fuzzing Java in OSS-Fuzz]: https://security.googleblog.com/2021/03/fuzzing-java-in-oss-fuzz.html
|
| 133 |
+
[Improving OSS-Fuzz and Jazzer to catch Log4Shell]: https://security.googleblog.com/2021/12/improving-oss-fuzz-and-jazzer-to-catch.html
|
| 134 |
+
[Fuzzing beyond memory corruption: Finding broader classes of vulnerabilities automatically]: https://security.googleblog.com/2022/09/fuzzing-beyond-memory-corruption.html
|
| 135 |
+
[Taking the next step: OSS-Fuzz in 2023]: https://security.googleblog.com/2023/02/taking-next-step-oss-fuzz-in-2023.html
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/ansible-runner-cve-2021-4041/build.sh
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash -eu
|
| 2 |
+
# Copyright 2022 Google LLC
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
#
|
| 16 |
+
################################################################################
|
| 17 |
+
|
| 18 |
+
python3 -m pip install pysecsan
|
| 19 |
+
|
| 20 |
+
git clone https://github.com/ansible/ansible-runner/
|
| 21 |
+
cd ansible-runner
|
| 22 |
+
git checkout cdc0961df51fa1e10b44371944aafe5ae140b98c
|
| 23 |
+
python3 -m pip install .
|
| 24 |
+
cd ..
|
| 25 |
+
python3 fuzz_ansible_runner.py
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/ansible-runner-cve-2021-4041/fuzz_ansible_runner.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/python3
|
| 2 |
+
# Copyright 2022 Google LLC
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
"""Targets: https://github.com/advisories/GHSA-6j58-grhv-2769."""
|
| 16 |
+
|
| 17 |
+
import sys
|
| 18 |
+
import atheris
|
| 19 |
+
import pexpect
|
| 20 |
+
import pysecsan
|
| 21 |
+
import ansible_runner
|
| 22 |
+
from ansible_runner.config.runner import RunnerConfig
|
| 23 |
+
|
| 24 |
+
pysecsan.add_hooks()
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def test_one_input(data):
|
| 28 |
+
"""Fuzzer entrypoint."""
|
| 29 |
+
fdp = atheris.FuzzedDataProvider(data)
|
| 30 |
+
|
| 31 |
+
conf = RunnerConfig('/tmp/')
|
| 32 |
+
conf.suppress_ansible_output = True
|
| 33 |
+
conf.expect_passwords = {pexpect.TIMEOUT: None, pexpect.EOF: None}
|
| 34 |
+
conf.cwd = str('/tmp/')
|
| 35 |
+
conf.env = {}
|
| 36 |
+
conf.job_timeout = 10
|
| 37 |
+
conf.idle_timeout = 0
|
| 38 |
+
conf.pexpect_timeout = 2.
|
| 39 |
+
conf.pexpect_use_poll = True
|
| 40 |
+
conf.command = 'from_fuzzer'
|
| 41 |
+
|
| 42 |
+
runner = ansible_runner.Runner(conf)
|
| 43 |
+
runner.resource_profiling = True
|
| 44 |
+
# rc.resource_profiling_base_cgroup = "; exec-san"
|
| 45 |
+
assistance = True
|
| 46 |
+
if assistance and fdp.ConsumeIntInRange(1, 100) > 80:
|
| 47 |
+
conf.resource_profiling_base_cgroup = 'FROMFUZZ'
|
| 48 |
+
else:
|
| 49 |
+
conf.resource_profiling_base_cgroup = fdp.ConsumeUnicodeNoSurrogates(24)
|
| 50 |
+
try:
|
| 51 |
+
runner.run()
|
| 52 |
+
except (RuntimeError, ValueError, TypeError) as _:
|
| 53 |
+
pass
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def main():
|
| 57 |
+
"""Set up and start fuzzing."""
|
| 58 |
+
atheris.instrument_all()
|
| 59 |
+
atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)
|
| 60 |
+
atheris.Fuzz()
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
if __name__ == '__main__':
|
| 64 |
+
main()
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/libvcs-cve-2022-21187/build.sh
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash -eu
|
| 2 |
+
# Copyright 2022 Google LLC
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
#
|
| 16 |
+
################################################################################
|
| 17 |
+
|
| 18 |
+
python3 -m pip install pysecsan
|
| 19 |
+
|
| 20 |
+
python3 -m pip install libvcs==0.11.0
|
| 21 |
+
python3 ./fuzz_libvcs.py
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/poe/libvcs-cve-2022-21187/fuzz_libvcs.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/python3
|
| 2 |
+
# Copyright 2022 Google LLC
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
"""Targets https://github.com/advisories/GHSA-mv2w-4jqc-6fg4."""
|
| 16 |
+
|
| 17 |
+
import sys
|
| 18 |
+
import atheris
|
| 19 |
+
import pysecsan
|
| 20 |
+
from libvcs.shortcuts import create_repo
|
| 21 |
+
|
| 22 |
+
pysecsan.add_hooks()
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def test_one_input(data):
|
| 26 |
+
"""Target code injection in libvcs."""
|
| 27 |
+
fdp = atheris.FuzzedDataProvider(data)
|
| 28 |
+
mercurial_repo = create_repo(url=fdp.ConsumeUnicodeNoSurrogates(128),
|
| 29 |
+
vcs='hg',
|
| 30 |
+
repo_dir='./')
|
| 31 |
+
try:
|
| 32 |
+
mercurial_repo.update_repo()
|
| 33 |
+
except (ValueError, FileNotFoundError) as exception:
|
| 34 |
+
_ = exception # Satisfy lint
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
"""Set up and start fuzzing."""
|
| 39 |
+
atheris.instrument_all()
|
| 40 |
+
atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)
|
| 41 |
+
atheris.Fuzz()
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
if __name__ == '__main__':
|
| 45 |
+
main()
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-builder/sanitizers/pysecsan/tests/yaml_deserialization_general.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/python3
|
| 2 |
+
# Copyright 2022 Google LLC
|
| 3 |
+
#
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
"""Fuzzer for insecure yaml deserialization."""
|
| 16 |
+
|
| 17 |
+
import sys
|
| 18 |
+
import yaml
|
| 19 |
+
import atheris
|
| 20 |
+
import pysecsan
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def serialize_with_tainted_data(param):
|
| 24 |
+
"""Hit insecure yaml function."""
|
| 25 |
+
try:
|
| 26 |
+
yaml.load(param, yaml.Loader)
|
| 27 |
+
except yaml.YAMLError:
|
| 28 |
+
pass
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def test_one_input(data):
|
| 32 |
+
"""Fuzzer routine."""
|
| 33 |
+
fdp = atheris.FuzzedDataProvider(data)
|
| 34 |
+
serialize_with_tainted_data(fdp.ConsumeUnicodeNoSurrogates(32))
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main():
|
| 38 |
+
"""Set up and start fuzzing."""
|
| 39 |
+
pysecsan.add_hooks()
|
| 40 |
+
|
| 41 |
+
atheris.instrument_all()
|
| 42 |
+
atheris.Setup(sys.argv, test_one_input, enable_python_coverage=True)
|
| 43 |
+
atheris.Fuzz()
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
if __name__ == '__main__':
|
| 47 |
+
main()
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/convertcorpus/go.mod
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module oss-fuzz.com/gocoverage/convertcorpus
|
| 2 |
+
|
| 3 |
+
go 1.19
|
| 4 |
+
|
| 5 |
+
require github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221110144148-3ffc89b74f84
|
| 6 |
+
|
| 7 |
+
require (
|
| 8 |
+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20220824214621-3c06a36a6952 // indirect
|
| 9 |
+
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
|
| 10 |
+
)
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/convertcorpus/go.sum
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20220824214621-3c06a36a6952 h1:cs1LC1MGKD1O4neR89Rc24t0u15Vs5ASfUQ2tLr/KbY=
|
| 2 |
+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20220824214621-3c06a36a6952/go.mod h1:i9fr2JpcEcY/IHEvzCM3qXUZYOQHgR89dt4es1CgMhc=
|
| 3 |
+
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221110144148-3ffc89b74f84 h1:a0NR83n+t4XyUh32ifxu6XsmeLMKyOx5Lxub9IeBM7k=
|
| 4 |
+
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221110144148-3ffc89b74f84/go.mod h1:pXIs8t4wo19ehhsffZsAZxSQ+oPUF41iiDrUaIDWKFU=
|
| 5 |
+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
| 6 |
+
github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI=
|
| 7 |
+
github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
| 8 |
+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
| 9 |
+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
| 10 |
+
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
| 11 |
+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
| 12 |
+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
| 13 |
+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
| 14 |
+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
| 15 |
+
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
| 16 |
+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
| 17 |
+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
| 18 |
+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
| 19 |
+
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 20 |
+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
| 21 |
+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
| 22 |
+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
| 23 |
+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
| 24 |
+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/convertcorpus/main.go
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package main
|
| 2 |
+
|
| 3 |
+
import (
|
| 4 |
+
"fmt"
|
| 5 |
+
"log"
|
| 6 |
+
"os"
|
| 7 |
+
"path/filepath"
|
| 8 |
+
|
| 9 |
+
"github.com/AdamKorcz/go-118-fuzz-build/coverage"
|
| 10 |
+
)
|
| 11 |
+
|
| 12 |
+
// reads all corpus files in a directory and converts
|
| 13 |
+
// them from libFuzzer format to native Go format.
|
| 14 |
+
func main() {
|
| 15 |
+
if len(os.Args) != 3 {
|
| 16 |
+
fmt.Println(os.Args)
|
| 17 |
+
log.Fatalf("need exactly two argument")
|
| 18 |
+
}
|
| 19 |
+
FUZZERNAME := os.Args[1]
|
| 20 |
+
CORPUS_PATH := os.Args[2]
|
| 21 |
+
|
| 22 |
+
filepath.Walk(CORPUS_PATH, func(path string, info os.FileInfo, err error) error {
|
| 23 |
+
if err != nil {
|
| 24 |
+
return nil
|
| 25 |
+
}
|
| 26 |
+
if !info.Mode().IsRegular() {
|
| 27 |
+
return nil
|
| 28 |
+
}
|
| 29 |
+
libFuzzerSeed, err := os.ReadFile(path)
|
| 30 |
+
if err != nil {
|
| 31 |
+
panic(err)
|
| 32 |
+
}
|
| 33 |
+
out := os.Getenv("OUT")
|
| 34 |
+
fuzzerContents, err := os.ReadFile(filepath.Join(out, "rawfuzzers", FUZZERNAME))
|
| 35 |
+
if err != nil {
|
| 36 |
+
panic(err)
|
| 37 |
+
}
|
| 38 |
+
goSeed := coverage.ConvertLibfuzzerSeedToGoSeed(fuzzerContents, libFuzzerSeed, FUZZERNAME)
|
| 39 |
+
err = os.Remove(path)
|
| 40 |
+
if err != nil {
|
| 41 |
+
panic(err)
|
| 42 |
+
}
|
| 43 |
+
f, err := os.Create(path)
|
| 44 |
+
if err != nil {
|
| 45 |
+
panic(err)
|
| 46 |
+
}
|
| 47 |
+
defer f.Close()
|
| 48 |
+
_, err = f.Write([]byte(goSeed))
|
| 49 |
+
if err != nil {
|
| 50 |
+
panic(err)
|
| 51 |
+
}
|
| 52 |
+
return nil
|
| 53 |
+
})
|
| 54 |
+
}
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/go.mod
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module oss-fuzz.com/gocoverage
|
| 2 |
+
|
| 3 |
+
go 1.14
|
| 4 |
+
|
| 5 |
+
require (
|
| 6 |
+
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5
|
| 7 |
+
golang.org/x/tools v0.1.0
|
| 8 |
+
)
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/go.sum
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
| 2 |
+
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
| 3 |
+
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
| 4 |
+
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5 h1:zIaiqGYDQwa4HVx5wGRTXbx38Pqxjemn4BP98wpzpXo=
|
| 5 |
+
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
| 6 |
+
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
| 7 |
+
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
| 8 |
+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
| 9 |
+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
| 10 |
+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
| 11 |
+
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
| 12 |
+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
| 13 |
+
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
| 14 |
+
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
| 15 |
+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 16 |
+
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
| 17 |
+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
| 18 |
+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 19 |
+
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 20 |
+
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 21 |
+
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
| 22 |
+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
| 23 |
+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
| 24 |
+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
| 25 |
+
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
| 26 |
+
golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
|
| 27 |
+
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
| 28 |
+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
| 29 |
+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
| 30 |
+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/gocovmerge/gocovmerge.go
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// gocovmerge takes the results from multiple `go test -coverprofile` runs and
|
| 2 |
+
// merges them into one profile
|
| 3 |
+
package main
|
| 4 |
+
|
| 5 |
+
import (
|
| 6 |
+
"flag"
|
| 7 |
+
"fmt"
|
| 8 |
+
"io"
|
| 9 |
+
"log"
|
| 10 |
+
"os"
|
| 11 |
+
"sort"
|
| 12 |
+
|
| 13 |
+
"golang.org/x/tools/cover"
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
func mergeProfiles(p *cover.Profile, merge *cover.Profile) {
|
| 17 |
+
if p.Mode != merge.Mode {
|
| 18 |
+
log.Fatalf("cannot merge profiles with different modes")
|
| 19 |
+
}
|
| 20 |
+
// Since the blocks are sorted, we can keep track of where the last block
|
| 21 |
+
// was inserted and only look at the blocks after that as targets for merge
|
| 22 |
+
startIndex := 0
|
| 23 |
+
for _, b := range merge.Blocks {
|
| 24 |
+
startIndex = mergeProfileBlock(p, b, startIndex)
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
func mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int) int {
|
| 29 |
+
sortFunc := func(i int) bool {
|
| 30 |
+
pi := p.Blocks[i+startIndex]
|
| 31 |
+
return pi.StartLine >= pb.StartLine && (pi.StartLine != pb.StartLine || pi.StartCol >= pb.StartCol)
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
i := 0
|
| 35 |
+
if sortFunc(i) != true {
|
| 36 |
+
i = sort.Search(len(p.Blocks)-startIndex, sortFunc)
|
| 37 |
+
}
|
| 38 |
+
i += startIndex
|
| 39 |
+
if i < len(p.Blocks) && p.Blocks[i].StartLine == pb.StartLine && p.Blocks[i].StartCol == pb.StartCol {
|
| 40 |
+
if p.Blocks[i].EndLine != pb.EndLine || p.Blocks[i].EndCol != pb.EndCol {
|
| 41 |
+
log.Fatalf("OVERLAP MERGE: %v %v %v", p.FileName, p.Blocks[i], pb)
|
| 42 |
+
}
|
| 43 |
+
switch p.Mode {
|
| 44 |
+
case "set":
|
| 45 |
+
p.Blocks[i].Count |= pb.Count
|
| 46 |
+
case "count", "atomic":
|
| 47 |
+
p.Blocks[i].Count += pb.Count
|
| 48 |
+
default:
|
| 49 |
+
log.Fatalf("unsupported covermode: '%s'", p.Mode)
|
| 50 |
+
}
|
| 51 |
+
} else {
|
| 52 |
+
if i > 0 {
|
| 53 |
+
pa := p.Blocks[i-1]
|
| 54 |
+
if pa.EndLine >= pb.EndLine && (pa.EndLine != pb.EndLine || pa.EndCol > pb.EndCol) {
|
| 55 |
+
log.Fatalf("OVERLAP BEFORE: %v %v %v", p.FileName, pa, pb)
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
if i < len(p.Blocks)-1 {
|
| 59 |
+
pa := p.Blocks[i+1]
|
| 60 |
+
if pa.StartLine <= pb.StartLine && (pa.StartLine != pb.StartLine || pa.StartCol < pb.StartCol) {
|
| 61 |
+
log.Fatalf("OVERLAP AFTER: %v %v %v", p.FileName, pa, pb)
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
p.Blocks = append(p.Blocks, cover.ProfileBlock{})
|
| 65 |
+
copy(p.Blocks[i+1:], p.Blocks[i:])
|
| 66 |
+
p.Blocks[i] = pb
|
| 67 |
+
}
|
| 68 |
+
return i + 1
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
func addProfile(profiles []*cover.Profile, p *cover.Profile) []*cover.Profile {
|
| 72 |
+
i := sort.Search(len(profiles), func(i int) bool { return profiles[i].FileName >= p.FileName })
|
| 73 |
+
if i < len(profiles) && profiles[i].FileName == p.FileName {
|
| 74 |
+
mergeProfiles(profiles[i], p)
|
| 75 |
+
} else {
|
| 76 |
+
profiles = append(profiles, nil)
|
| 77 |
+
copy(profiles[i+1:], profiles[i:])
|
| 78 |
+
profiles[i] = p
|
| 79 |
+
}
|
| 80 |
+
return profiles
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
func dumpProfiles(profiles []*cover.Profile, out io.Writer) {
|
| 84 |
+
if len(profiles) == 0 {
|
| 85 |
+
return
|
| 86 |
+
}
|
| 87 |
+
fmt.Fprintf(out, "mode: %s\n", profiles[0].Mode)
|
| 88 |
+
for _, p := range profiles {
|
| 89 |
+
for _, b := range p.Blocks {
|
| 90 |
+
fmt.Fprintf(out, "%s:%d.%d,%d.%d %d %d\n", p.FileName, b.StartLine, b.StartCol, b.EndLine, b.EndCol, b.NumStmt, b.Count)
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
func main() {
|
| 96 |
+
flag.Parse()
|
| 97 |
+
|
| 98 |
+
var merged []*cover.Profile
|
| 99 |
+
|
| 100 |
+
for _, file := range flag.Args() {
|
| 101 |
+
profiles, err := cover.ParseProfiles(file)
|
| 102 |
+
if err != nil {
|
| 103 |
+
log.Fatalf("failed to parse profiles: %v", err)
|
| 104 |
+
}
|
| 105 |
+
for _, p := range profiles {
|
| 106 |
+
merged = addProfile(merged, p)
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
dumpProfiles(merged, os.Stdout)
|
| 111 |
+
}
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/gocovsum/gocovsum.go
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2023 Google LLC
|
| 2 |
+
//
|
| 3 |
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
// you may not use this file except in compliance with the License.
|
| 5 |
+
// You may obtain a copy of the License at
|
| 6 |
+
//
|
| 7 |
+
// http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
//
|
| 9 |
+
// Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
// See the License for the specific language governing permissions and
|
| 13 |
+
// limitations under the License.
|
| 14 |
+
|
| 15 |
+
package main
|
| 16 |
+
|
| 17 |
+
import (
|
| 18 |
+
"encoding/json"
|
| 19 |
+
"flag"
|
| 20 |
+
"fmt"
|
| 21 |
+
"log"
|
| 22 |
+
|
| 23 |
+
"go/ast"
|
| 24 |
+
"go/parser"
|
| 25 |
+
"go/token"
|
| 26 |
+
|
| 27 |
+
"golang.org/x/tools/cover"
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
type CoverageTotal struct {
|
| 31 |
+
Count int `json:"count"`
|
| 32 |
+
Covered int `json:"covered"`
|
| 33 |
+
Uncovered int `json:"notcovered"`
|
| 34 |
+
Percent float64 `json:"percent"`
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
type CoverageTotals struct {
|
| 38 |
+
Functions CoverageTotal `json:"functions,omitempty"`
|
| 39 |
+
Lines CoverageTotal `json:"lines,omitempty"`
|
| 40 |
+
Regions CoverageTotal `json:"regions,omitempty"`
|
| 41 |
+
Instantiations CoverageTotal `json:"instantiations,omitempty"`
|
| 42 |
+
Branches CoverageTotal `json:"branches,omitempty"`
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
type CoverageFile struct {
|
| 46 |
+
Summary CoverageTotals `json:"summary,omitempty"`
|
| 47 |
+
Filename string `json:"filename,omitempty"`
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
type CoverageData struct {
|
| 51 |
+
Totals CoverageTotals `json:"totals,omitempty"`
|
| 52 |
+
Files []CoverageFile `json:"files,omitempty"`
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
type PositionInterval struct {
|
| 56 |
+
start token.Position
|
| 57 |
+
end token.Position
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
type CoverageSummary struct {
|
| 61 |
+
Data []CoverageData `json:"data,omitempty"`
|
| 62 |
+
Type string `json:"type,omitempty"`
|
| 63 |
+
Version string `json:"version,omitempty"`
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
func isFunctionCovered(s token.Position, e token.Position, blocks []cover.ProfileBlock) bool {
|
| 67 |
+
for _, b := range blocks {
|
| 68 |
+
if b.StartLine >= s.Line && b.StartLine <= e.Line && b.EndLine >= s.Line && b.EndLine <= e.Line {
|
| 69 |
+
if b.Count > 0 {
|
| 70 |
+
return true
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
return false
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
func computePercent(s *CoverageTotals) {
|
| 78 |
+
if s.Regions.Count > 0 {
|
| 79 |
+
s.Regions.Percent = float64(100*s.Regions.Covered) / float64(s.Regions.Count)
|
| 80 |
+
}
|
| 81 |
+
if s.Lines.Count > 0 {
|
| 82 |
+
s.Lines.Percent = float64(100*s.Lines.Covered) / float64(s.Lines.Count)
|
| 83 |
+
}
|
| 84 |
+
if s.Functions.Count > 0 {
|
| 85 |
+
s.Functions.Percent = float64(100*s.Functions.Covered) / float64(s.Functions.Count)
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
func main() {
|
| 90 |
+
flag.Parse()
|
| 91 |
+
|
| 92 |
+
if len(flag.Args()) != 1 {
|
| 93 |
+
log.Fatalf("needs exactly one argument")
|
| 94 |
+
}
|
| 95 |
+
profiles, err := cover.ParseProfiles(flag.Args()[0])
|
| 96 |
+
if err != nil {
|
| 97 |
+
log.Fatalf("failed to parse profiles: %v", err)
|
| 98 |
+
}
|
| 99 |
+
r := CoverageSummary{}
|
| 100 |
+
r.Type = "oss-fuzz.go.coverage.json.export"
|
| 101 |
+
r.Version = "2.0.1"
|
| 102 |
+
r.Data = make([]CoverageData, 1)
|
| 103 |
+
for _, p := range profiles {
|
| 104 |
+
fset := token.NewFileSet() // positions are relative to fset
|
| 105 |
+
f, err := parser.ParseFile(fset, p.FileName, nil, 0)
|
| 106 |
+
if err != nil {
|
| 107 |
+
log.Printf("failed to parse go file: %v", err)
|
| 108 |
+
continue
|
| 109 |
+
}
|
| 110 |
+
fileCov := CoverageFile{}
|
| 111 |
+
fileCov.Filename = p.FileName
|
| 112 |
+
ast.Inspect(f, func(n ast.Node) bool {
|
| 113 |
+
switch x := n.(type) {
|
| 114 |
+
case *ast.FuncLit:
|
| 115 |
+
startf := fset.Position(x.Pos())
|
| 116 |
+
endf := fset.Position(x.End())
|
| 117 |
+
fileCov.Summary.Functions.Count++
|
| 118 |
+
if isFunctionCovered(startf, endf, p.Blocks) {
|
| 119 |
+
fileCov.Summary.Functions.Covered++
|
| 120 |
+
} else {
|
| 121 |
+
fileCov.Summary.Functions.Uncovered++
|
| 122 |
+
}
|
| 123 |
+
case *ast.FuncDecl:
|
| 124 |
+
startf := fset.Position(x.Pos())
|
| 125 |
+
endf := fset.Position(x.End())
|
| 126 |
+
fileCov.Summary.Functions.Count++
|
| 127 |
+
if isFunctionCovered(startf, endf, p.Blocks) {
|
| 128 |
+
fileCov.Summary.Functions.Covered++
|
| 129 |
+
} else {
|
| 130 |
+
fileCov.Summary.Functions.Uncovered++
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
return true
|
| 134 |
+
})
|
| 135 |
+
|
| 136 |
+
for _, b := range p.Blocks {
|
| 137 |
+
fileCov.Summary.Regions.Count++
|
| 138 |
+
if b.Count > 0 {
|
| 139 |
+
fileCov.Summary.Regions.Covered++
|
| 140 |
+
} else {
|
| 141 |
+
fileCov.Summary.Regions.Uncovered++
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
fileCov.Summary.Lines.Count += b.NumStmt
|
| 145 |
+
if b.Count > 0 {
|
| 146 |
+
fileCov.Summary.Lines.Covered += b.NumStmt
|
| 147 |
+
} else {
|
| 148 |
+
fileCov.Summary.Lines.Uncovered += b.NumStmt
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
r.Data[0].Totals.Regions.Count += fileCov.Summary.Regions.Count
|
| 152 |
+
r.Data[0].Totals.Regions.Covered += fileCov.Summary.Regions.Covered
|
| 153 |
+
r.Data[0].Totals.Regions.Uncovered += fileCov.Summary.Regions.Uncovered
|
| 154 |
+
r.Data[0].Totals.Lines.Count += fileCov.Summary.Lines.Count
|
| 155 |
+
r.Data[0].Totals.Lines.Covered += fileCov.Summary.Lines.Covered
|
| 156 |
+
r.Data[0].Totals.Lines.Uncovered += fileCov.Summary.Lines.Uncovered
|
| 157 |
+
r.Data[0].Totals.Functions.Count += fileCov.Summary.Functions.Count
|
| 158 |
+
r.Data[0].Totals.Functions.Covered += fileCov.Summary.Functions.Covered
|
| 159 |
+
r.Data[0].Totals.Functions.Uncovered += fileCov.Summary.Functions.Uncovered
|
| 160 |
+
|
| 161 |
+
computePercent(&fileCov.Summary)
|
| 162 |
+
r.Data[0].Files = append(r.Data[0].Files, fileCov)
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
computePercent(&r.Data[0].Totals)
|
| 166 |
+
o, err := json.Marshal(r)
|
| 167 |
+
if err != nil {
|
| 168 |
+
log.Fatalf("failed to generate json: %v", err)
|
| 169 |
+
}
|
| 170 |
+
fmt.Printf(string(o))
|
| 171 |
+
}
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/pprof-merge/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright {yyyy} {name of copyright owner}
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
local-test-zookeeper-delta-01/fuzz-tooling/infra/base-images/base-runner/gocoverage/pprof-merge/main.go
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2019 Google Inc. All Rights Reserved.
|
| 2 |
+
//
|
| 3 |
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
// you may not use this file except in compliance with the License.
|
| 5 |
+
// You may obtain a copy of the License at
|
| 6 |
+
//
|
| 7 |
+
// http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
//
|
| 9 |
+
// Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
// See the License for the specific language governing permissions and
|
| 13 |
+
// limitations under the License.
|
| 14 |
+
|
| 15 |
+
package main
|
| 16 |
+
|
| 17 |
+
import (
|
| 18 |
+
"flag"
|
| 19 |
+
"log"
|
| 20 |
+
"os"
|
| 21 |
+
|
| 22 |
+
"github.com/google/pprof/profile"
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
var (
|
| 26 |
+
output string
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
func main() {
|
| 30 |
+
flag.StringVar(&output, "o", "merged.data", "")
|
| 31 |
+
flag.Parse()
|
| 32 |
+
|
| 33 |
+
files := os.Args[1:]
|
| 34 |
+
if len(files) == 0 {
|
| 35 |
+
log.Fatal("Give profiles files as arguments")
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
var profiles []*profile.Profile
|
| 39 |
+
for _, fname := range files {
|
| 40 |
+
f, err := os.Open(fname)
|
| 41 |
+
if err != nil {
|
| 42 |
+
log.Fatalf("Cannot open profile file at %q: %v", fname, err)
|
| 43 |
+
}
|
| 44 |
+
p, err := profile.Parse(f)
|
| 45 |
+
if err != nil {
|
| 46 |
+
log.Fatalf("Cannot parse profile at %q: %v", fname, err)
|
| 47 |
+
}
|
| 48 |
+
profiles = append(profiles, p)
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
merged, err := profile.Merge(profiles)
|
| 52 |
+
if err != nil {
|
| 53 |
+
log.Fatalf("Cannot merge profiles: %v", err)
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
out, err := os.OpenFile(output, os.O_RDWR|os.O_CREATE, 0755)
|
| 57 |
+
if err != nil {
|
| 58 |
+
log.Fatalf("Cannot open output to write: %v", err)
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
if err := merged.Write(out); err != nil {
|
| 62 |
+
log.Fatalf("Cannot write merged profile to file: %v", err)
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
if err := out.Close(); err != nil {
|
| 66 |
+
log.Printf("Error when closing the output file: %v", err)
|
| 67 |
+
}
|
| 68 |
+
}
|