Commit Graph

1972 Commits

Author SHA1 Message Date
Raphael Salas 4dbcd5f3a1
added architecture option to helper reproduce command (#9089)
Similar to #8972, reproducing seems to assume architecture and doesn't
allow specifying a target. This PR adds the `--architecture` flag to the
reproduce command, allowing reproduction in the target platform.

Tested by running `build_fuzzers` and then `reproduce` with defaults.
Now using `--architecture aarch64` works to reproduce.
2022-12-13 10:52:14 +11:00
DavidKorczynski 7556698dbc
infra: make it possible to download public corpus (#9155)
Ref: https://github.com/ossf/fuzz-introspector/issues/587

CC @evverx 

Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
2022-12-12 09:35:17 -08:00
jonathanmetzman a9d8d7bb61
[CFL] Allow users to specify custom env vars for building/running (#9171)
They can do this by prefix the env var with CFL_EXTRA_. E.g.
`CFL_EXTRA_BUILD_SERVICE_TOKEN=<redacted>`.
Fixes: https://github.com/google/oss-fuzz/issues/9170
2022-12-12 11:00:19 -05:00
DavidKorczynski 1b6c740e2d
infra: replace characters to fuzztest coverage urls (#9167)
The corpus URL generated for fuzztest fuzzers is invalid due to the use
of `@` and `.` characters in the fuzzer names.

The current URL created is e.g.
`gs://fuzztest-raksha-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/fuzztest-raksha_value_test@NumberTest.RoundTripNumberThroughDatalogString/`
whereas the correct URL is
`gs://fuzztest-raksha-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/fuzztest-raksha_value_test-NumberTest-RoundTripNumberThroughDatalogString/`.

Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
2022-12-12 10:27:05 +11:00
Navidem f6ef7cc41a
Bump FI (#9173) 2022-12-12 09:28:18 +11:00
Navidem 35d2567c9c
Add analytic tag for FuzzIntrospector. (#9178)
Fixes #9039.
2022-12-11 17:08:49 +11:00
DavidKorczynski ebe05f04ce
infra: add project name to python FI reports (#9174)
Fixes: https://github.com/ossf/fuzz-introspector/issues/674
2022-12-09 11:27:15 -08:00
jonathanmetzman 59293013b6
Upgrade packages (related: #9151) (#9164) 2022-12-07 17:50:21 -05:00
jonathanmetzman 4799eb3012
Undo 2022-12-06 17:40:56 -05:00
Catena cyber a857bfbca0
SystemSan: arbitrary DNS resolution detection (#9119)
cc @oliverchang @Alan32Liu after #9100 and #8448

After compiling locally, I can see that
`./SystemSan ./target_dns -dict=vuln.dict`
crashes in a few seconds with
```
===BUG DETECTED: Arbitrary domain name resolution===
===Domain resolved: .f.z===
===DNS request type: 0, class: 256===
==315== ERROR: libFuzzer: deadly signal
    #0 0x539131 in __sanitizer_print_stack_trace /src/llvm-project/compiler-rt/lib/asan/asan_stack.cpp:87:3
    #1 0x457c48 in fuzzer::PrintStackTrace() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerUtil.cpp:210:5
    #2 0x43c923 in fuzzer::Fuzzer::CrashCallback() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:233:3
    #3 0x7fa57940041f  (/lib/x86_64-linux-gnu/libpthread.so.0+0x1441f) (BuildId: 7b4536f41cdaa5888408e82d0836e33dcf436466)
    #4 0x7fa5793ff7db in send (/lib/x86_64-linux-gnu/libpthread.so.0+0x137db) (BuildId: 7b4536f41cdaa5888408e82d0836e33dcf436466)
    #5 0x503ba4 in __interceptor_send /src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:6802:17
    #6 0x7fa578abf462  (/lib/x86_64-linux-gnu/libresolv.so.2+0xb462) (BuildId: 4519041bde5b859c55798ac0745b0b6199cb7d94)
    #7 0x7fa578abbc43 in __res_context_query (/lib/x86_64-linux-gnu/libresolv.so.2+0x7c43) (BuildId: 4519041bde5b859c55798ac0745b0b6199cb7d94)
    #8 0x7fa578abc8ed in __res_context_search (/lib/x86_64-linux-gnu/libresolv.so.2+0x88ed) (BuildId: 4519041bde5b859c55798ac0745b0b6199cb7d94)
    #9 0x7fa578ad2cc1  (/lib/x86_64-linux-gnu/libnss_dns.so.2+0x2cc1) (BuildId: 3fac4ec397ba8e8938fe298f103113f315465130)
    #10 0x7fa578ad2e8b in _nss_dns_gethostbyname3_r (/lib/x86_64-linux-gnu/libnss_dns.so.2+0x2e8b) (BuildId: 3fac4ec397ba8e8938fe298f103113f315465130)
    #11 0x7fa578ad2f41 in _nss_dns_gethostbyname2_r (/lib/x86_64-linux-gnu/libnss_dns.so.2+0x2f41) (BuildId: 3fac4ec397ba8e8938fe298f103113f315465130)
    #12 0x7fa5792fdc9d in gethostbyname2_r (/lib/x86_64-linux-gnu/libc.so.6+0x130c9d) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #13 0x7fa5792d179e  (/lib/x86_64-linux-gnu/libc.so.6+0x10479e) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #14 0x7fa5792d2f58 in getaddrinfo (/lib/x86_64-linux-gnu/libc.so.6+0x105f58) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #15 0x4d93ac in getaddrinfo /src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:2667:13
    #16 0x56c8d9 in LLVMFuzzerTestOneInput /out/SystemSan/target_dns.cpp:35:11
    #17 0x43dec3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #18 0x43d6aa in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #19 0x43ed79 in fuzzer::Fuzzer::MutateAndTestOne() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:757:19
    #20 0x43fa45 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:895:5
    #21 0x42edaf in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #22 0x458402 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #23 0x7fa5791f1082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #24 0x41f7ed in _start (/out/SystemSan/target_dns+0x41f7ed)

NOTE: libFuzzer has rudimentary signal handlers.
      Combine libFuzzer with AddressSanitizer or similar for better crash reports.
SUMMARY: libFuzzer: deadly signal
MS: 2 CrossOver-ManualDict- DE: "f.z"-; base unit: ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4
0x66,0x2e,0x7a,
f.z
artifact_prefix='./'; Test unit written to ./crash-926813b2d6adde373f96a10594a5314951588384
Base64: Zi56
```

You can also try
```
echo -n f.z > toto
./SystemSan ./target_dns toto  
```

Co-authored-by: Oliver Chang <oliverchang@users.noreply.github.com>
Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
2022-12-06 08:23:32 -05:00
Oliver Chang 298b1fdb3d
Disable arbitrary file read sanitizer. (#9142)
This is currently too noisy, and may mask our other sanitizers.

We can re-enable this once we have flag/options support.
2022-12-06 11:54:32 +11:00
jonathanmetzman 1ea19bdf1d
update requirements.txt (#9109) 2022-12-05 09:45:59 -05:00
jonathanmetzman 1766eda106
Update package-lock (#9108) 2022-12-05 09:44:59 -05:00
jonathanmetzman fe2c5413c9
update requirements.txt (#9110) 2022-12-05 09:44:31 -05:00
jonathanmetzman 086adbf2d2
update requirements.txt (#9111) 2022-12-05 09:44:14 -05:00
jonathanmetzman 569acfaa87
Test SystemSan with Python (#8443) 2022-12-01 15:58:58 +11:00
Oliver Chang 8acb150e82
Revert "SystemSan: arbitrary DNS resolution detection" (#9100)
Reverts google/oss-fuzz#8448.

Build was broken in several places. 

Even once fixed, the `target_dns` example didn't work.
2022-12-01 15:08:39 +11:00
Catena cyber 98eda2bc0d
SystemSan: arbitrary DNS resolution detection (#8448)
cc @oliverchang @jonathanmetzman 

Here is a new bug class for SystemSan : arbitrary DNS resolution (like
in log4j)

What do you think about it ?
2022-12-01 13:50:15 +11:00
jonathanmetzman a9f9cda4cc
Fuzz OSS-Fuzz with Atheris and ClusterFuzzLite (#8985) 2022-11-30 15:37:36 -05:00
jonathanmetzman 675c275884
[cifuzz] Add timeout to http requests. (#9084)
Fixes https://github.com/google/oss-fuzz/issues/9079
2022-11-29 08:32:27 -05:00
DavidKorczynski 529a009be5
infra: refine fuzztest work (#8992)
Enable Fuzztest fuzzers for Tensorflow.

This depends on https://github.com/google/fuzztest/pull/79 and
eventually a PR on the tensorflow repo with the (to be refined) diff in
this PR.

Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
Co-authored-by: Oliver Chang <oliverchang@users.noreply.github.com>
2022-11-28 18:17:41 +11:00
Navidem 41f9210a29
Revert "[infra] Update Jazzer to latest main" (#9055)
Reverts google/oss-fuzz#9027
per @fmeum request.
2022-11-24 02:21:20 +00:00
Dongge Liu 3ba9eabc27
Update centipede (#9029)
Update `Centipede` to its latest version.
2022-11-23 10:01:38 +11:00
Fabian Meumertzheim 33c5ce4d6f
[infra] Update Jazzer to latest main (#9027)
Reuses the previous Jazzer file names so that no changes to ClusterFuzz
are required.
2022-11-22 09:23:42 -05:00
Dongge Liu 6a4ecab2fb
Disable -Werror on unused-command-line-argument (#9030)
Some projects use `-Werror` to turn all warnings into errors.
This affects `Centipede` as we do not separate build and linking flags
as it expects, which leads to `unused-command-line-argument` warnings.
This PR disables turning that specific warning into errors and keeps the
rest the same.
2022-11-22 21:29:33 +11:00
jonathanmetzman ba1cb7be26
Add helper scripts for wycheproof (#9008)
Related: https://github.com/google/oss-fuzz/issues/8034
2022-11-21 17:20:42 -05:00
AdamKorcz 63c99caae9
Refactor infra of Go 1.18 fuzzers (#8937)
`go-118-fuzz-build` is undergoing refactoring to fix some runtime issues
affecting Rekor and other projects. Currently none of Rekors fuzzers
run. This PR has been tested on all of Rekors fuzzers that will run with
this PR.

This PR modifies the infra OSS-Fuzz build script to adapt to the
upstream changes.

Cloning the `dev` branch of `go-118-fuzz-build` is a temporary solution
until it gets merged into `main` upstream.
Cloning go-118-fuzz-build in each build script is also a temporary
measure until `dev` gets merged into `main`.

Signed-off-by: AdamKorcz <adam@adalogics.com>

Signed-off-by: AdamKorcz <adam@adalogics.com>
2022-11-21 17:55:11 +00:00
DavidKorczynski 216ec0b8a4
infra: base-builder: refine fuzz-introspector building (#9004)
- Pass coverage_url to both c/c++ and python report generation.
- Remove a double calling of introspector report generation.

Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
2022-11-21 07:21:59 -08:00
jonathanmetzman 0f3a505e5c
Fix up bc-java-wycheproof and enable build (#8983) 2022-11-17 15:11:59 -05:00
jonathanmetzman 659e1fdd58
Allow skipping trial builds (#8991)
This is useful for NFCs
2022-11-16 20:48:45 +00:00
jonathanmetzman 8df818599b
[cifuzz] Update docs (#8984) 2022-11-16 12:46:27 -08:00
jonathanmetzman 3ebdb071dc
Remove centipede's .git (#8986)
It takes up space, is uneeded and causes irrelevant data to be displayed
in revisions.
2022-11-16 07:53:04 -05:00
DavidKorczynski 45895f868a
infra: bump fuzz-introspector (#8979)
Contains fixes for some python projects that are failing to be analysed.

Ref: https://github.com/ossf/fuzz-introspector/pull/606
2022-11-14 20:42:52 +00:00
DavidKorczynski 9452275da3
fuzztest integration (#8784)
Signed-off-by: David Korczynski <david@adalogics.com>

Cross referencing https://github.com/google/fuzztest/pull/69

Signed-off-by: David Korczynski <david@adalogics.com>
Co-authored-by: Oliver Chang <oliverchang@users.noreply.github.com>
2022-11-14 13:34:29 +11:00
Raphael Salas 14ec4885b4
added architecture flag to coverage helper command (#8972)
Currently if you make a coverage build for a particular architecture
(e.g. aarch64), running the coverage command doesn't work as it assumes
`x86_64`. This PR adds the `--architecture` flag present in other
commands for parity, allowing to run coverage reports built for the
matching architecture.

Tested by running `build_fuzzers` and then `coverage` works as expected
with defaults (x86_64).

Now `build_fuzzers` and then `coverage` also work when `--architecture
aarch64` is used.
2022-11-11 00:32:23 +00:00
DavidKorczynski 4e2f86d3ea
infra: bump fuzz introspector (#8970)
This has a fix for coverage urls for per-fuzzer coverage reports:
https://github.com/ossf/fuzz-introspector/pull/605

Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
2022-11-10 14:12:33 -08:00
Navidem 426b8f5f19
Fix Introspector trial build (#8971)
Skip using `-testing` bucket as it breaks coverage download under
`trial_build`.
2022-11-10 13:54:57 -08:00
Catena cyber d5dc144ad1
SystemSan: log c_str to avoid additional buffered zeroes (#8826)
cc @Alan32Liu
2022-11-10 16:06:07 +11:00
Oliver Chang d104f15f90
Fix incorrect os.stat usage. (#8964) 2022-11-10 04:17:23 +00:00
DavidKorczynski 8b9cf2d081
infra: bump introspector and update python compile script (#8957)
This is a follow-up to https://github.com/google/oss-fuzz/pull/8952

This bump is needed to have the Python projects work properly. Scan
should be done for all projects now, so have switched it on by default
in fuzz introspector.

Bump also contains
- Fix for util-linux where per-target coverage report links were broken.
- Reduced logging.

Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
Co-authored-by: Navidem <navid.emamdoost@gmail.com>
2022-11-09 17:49:17 -08:00
Navidem fb2592f6f8
Fix Python Coverage Build (#8959)
Skip per_target coverage copy for python.

Co-authored-by: Dongge Liu <donggeliu@google.com>
2022-11-09 17:48:50 -08:00
Navidem bba5bc97d7
Simplify download coverage steps (#8960)
With the python projects enabled, we need to broaden the coverage file
names that should to be downloaded.

This PR changes `download_coverage_data_steps()` function to download
all the contents of `textcov_reports` dir from the coverage bucket.
2022-11-09 17:48:35 -08:00
jonathanmetzman 7bc9fbd3b4
Make sure testcase has correct permissions (#8920)
Fixes #8768
2022-11-09 16:37:36 -05:00
DavidKorczynski 50205ec9e9
infra: bump and refine introspector (#8952)
Bumps fuzz introspector and updates the way python fuzzers are build for
introspector builds.

Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
2022-11-08 23:13:31 -08:00
DavidKorczynski 7797279c27
infra: base-builder: compile: wrap find names in quotes (#8943)
Wrap wildcards in quotes as otherwise the script will autocomplete if
there is a e.g. .json file in the current directory. This causes the
wrong files to be moved, which means `all_cov.json` will not be moved to
the introspector folder and thus wrong (no) coverage data will be used.

This error happens in e.g. g-api-auth-library-python
2022-11-09 09:24:41 +11:00
Navidem 490a91a265
Enable Introspector on Python projects (#8945) 2022-11-07 22:48:16 +00:00
Fabian Meumertzheim 514febd38c
java: Fix bash escaping in memory setting logic (#8825)
These issues were missed in 5b1953b201 and
prevent the new logic from applying correctly for some projects.
2022-11-07 10:34:37 -08:00
jonathanmetzman 3f14b420ef
[CFL] Don't print fuzzing logs in realtime (#8919)
Fixes https://github.com/google/oss-fuzz/issues/8588
2022-11-07 11:11:51 -05:00
jonathanmetzman b975afe5e3
[wycheproof] Fix typo (#8935) 2022-11-07 09:16:31 -05:00
jonathanmetzman e9ca7b1120
Create blackbox fuzzer for wycheproof. (#8926)
Related: https://github.com/google/oss-fuzz/issues/8034
2022-11-07 07:07:31 -05:00