Commit Graph

2010 Commits

Author SHA1 Message Date
jonathanmetzman c8d43c3a49
[cifuzz] Dont report crash on process timeout. (#9484)
Just because nonzero is reported doesn't mean there's a crash.

Related: https://github.com/google/oss-fuzz/issues/9470
https://github.com/google/oss-fuzz/issues/9318
https://github.com/prometheus/prometheus/issues/11810
2023-01-23 13:02:47 -05:00
jonathanmetzman 474342414d
[presubmit] Ban committing of seed corpora. (#8517)
We can't allow this or we will slow down every clone of OSS-Fuzz (bad
for CIFuzz).
2023-01-23 16:37:04 +00:00
jonathanmetzman 0d515aa665
Add tzdata to match clusterfuzz (#9284)
Fixes https://github.com/google/oss-fuzz/issues/9280
2023-01-23 10:33:32 -05:00
Catena cyber 107f33937f
SystemSan: log correct dns type and class (#9476)
by skipping final null byte of domain name
2023-01-23 09:48:14 +11:00
DavidKorczynski 5402b1c2bf
bump introspector (#9465)
This is to include silencing of some HTML report generation that is WIP:
https://github.com/ossf/fuzz-introspector/pull/777
2023-01-19 15:46:01 -08:00
Navidem 69ba24b86d
Enable Introspector for jvm (#9440) 2023-01-19 13:13:09 -08:00
Navidem b3b439c8e4
Bump FI (#9460) 2023-01-19 08:06:57 -08:00
DavidKorczynski 91d35e7d39
infra: bump introspector (#9406)
The main changes are:
- improvements to code injection sink analyser
- output of data about all functions into summary.json. This is useful
for e.g. comparing reports and making historical analysis.

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

Signed-off-by: David Korczynski <david@adalogics.com>
2023-01-19 00:26:22 -08:00
Dongge Liu e1529c3ee3
Update Centipede to eb91dd2 (#9426)
Update Centipede to [its latest commit
eb91dd2](eb91dd2157),
which added some new features and fixed runtime bugs found in recent
FuzzBench experiments.
2023-01-16 13:14:45 +11:00
Oliver Chang 37179d7e8d
Fix exception in bisector.py (#9399)
The `run_function` is passed an `architecture` keyword argument:

a8cb9370f0/infra/helper.py (L1357)

This makes the `run_function` passed in the bisector ignore all keyword
arguments.

Related: https://github.com/google/osv.dev/issues/963
2023-01-12 09:26:10 +11:00
jonathanmetzman 3ba1527349
Bump ClusterFuzz to 2.5.9 (#9394) 2023-01-10 13:00:01 -05:00
jonathanmetzman b6285aa410
[cfl] Allow longer to repro issues in Python (#9292)
Fixes #9222

Co-authored-by: Dongge Liu <donggeliu@google.com>
2023-01-10 17:40:59 +11:00
Oliver Chang a366b1c90b
Revert "[SystemSan] Add feature for opting out." (#9386)
Reverts google/oss-fuzz#9221.

Nothing was setting this yet.
2023-01-10 13:09:39 +11:00
DavidKorczynski beef253ac7
infra: build: functions: cut corpus directory by last period (#9302)
When a corpus zip file is unzipped the destination folder is set to be
the directory corresponding to the filepath of the zip file but without
".zip" in the name. This is achieved by `for f in /corpus/*.zip; do
unzip -q $f -d ${f%%.*}` where `f%%.*` substitutes the path of `f` based
on the first occurrence of ".". This causes some issues with fuzztest
fuzzers where a fuzzer name always has a "." in it, e.g.

`escaping_test@EscapingTest.EscapingAStringNeverTriggersUndefinedBehavior`

Substituting the name in this way causes issues for some coverage builds
e.g.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53479

This changes it to substiute based on the last occurrence of ".", i.e.
just cutting off the ".zip".

Alternatively, we could substitute over
e.g. ".zip", however, this may cause some issues as a fuzztest fuzzer
may have ".zip" in the name.

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

Signed-off-by: David Korczynski <david@adalogics.com>
2023-01-04 09:52:09 +11:00
jonathanmetzman 49c2379eab
[cifuzz] Upgrade artifact package (#9347) 2023-01-03 16:35:21 -05:00
jonathanmetzman 11a21c2b6a
[centipede] Turn off warnings during compilation. (#9301)
Related: https://github.com/google/oss-fuzz/issues/9299
2023-01-03 11:44:12 -05:00
jonathanmetzman ab04f459fa
Log base-image part of trial builds to bucket (#9303)
We can make this public if we want.
You can observe the logs in real time by clicking on "details" of trial
build, getting `$BUILD_ID` and then doing
`gsutil cat gs://oss-fuzz-trialbuild-logs/log-$BUILD_ID.txt`
2022-12-30 13:41:04 -08:00
jonathanmetzman 468119f09f
[trial_build] Support specifying language (#9242) 2022-12-29 10:58:33 -05:00
Navidem 9a3498ed88
Fix the introspector report directory in helper.py (#9273)
The reports are written into
`oss-fuzz/build/out/PROJECT/introspector-report/inspector/`
2022-12-24 23:27:17 +00:00
DavidKorczynski 05676662d4
infra: bump fuzz introspector (#9263)
The main purpose of this is to fix
https://github.com/ossf/fuzz-introspector/issues/729
2022-12-22 11:00:30 -08:00
Evgeny Vereshchagin 63e3493664
[infra] delete directories with FI reports with rmtree (#9265)
Those directories aren't empty usually so `rmdir` fails with
```
INFO:fuzz_introspector.json_report:Finish handling sections that need json output
INFO:__main__:Ending fuzz introspector report generation
INFO:__main__:Ending fuzz introspector post-processing
Traceback (most recent call last):
  File "/home/vagrant/oss-fuzz-2/./infra/helper.py", line 1513, in <module>
    sys.exit(main())
  File "/home/vagrant/oss-fuzz-2/./infra/helper.py", line 192, in main
    result = introspector(args)
  File "/home/vagrant/oss-fuzz-2/./infra/helper.py", line 1243, in introspector
    os.rmdir(introspector_dst)
OSError: [Errno 39] Directory not empty: '/home/vagrant/oss-fuzz-2/build/out/dbus-broker/introspector-report'
```

It should make it possible to run `introspector` a few times in a row
when for example fuzz targets are changed locally between subsequent
runs.

It's a follow-up to https://github.com/google/oss-fuzz/pull/9243.
2022-12-22 09:57:13 -08:00
DavidKorczynski 7d27c4cb05
infra: make it possible to do a full introspector run (#9243)
Make it possible to do a full run of introspector locally. This will
make it a lot easier for users to integrate it into the fuzzer building
workflow.

To trigger, just run: `python3 infra/helper.py introspector PROJ_NAME`

Other example commands:
`python3 infra/helper.py introspector --public-corpora PROJ_NAME` : will
download the latest public corpus for project PROJ_NAME and use that
when collecting coverage
`python3 infra/helper.py introspector --seconds=X PROJ_NAME`: will run
the fuzzers for X seconds for corpus collection
`python3 infra/helper.py introspector PROJ_NAME LOCAL_PATH` will do the
introspector run using the LOCAL_PATH as source code folder (for testing
modifications)

Ref: https://github.com/ossf/fuzz-introspector/issues/587

Signed-off-by: David Korczynski <david@adalogics.com>
2022-12-21 04:48:01 -08:00
AdamKorcz ba8bea455a
native go infra: switch to main branch (#9103)
Fixes:
https://github.com/google/oss-fuzz/pull/8937#discussion_r1021005743

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

Signed-off-by: AdamKorcz <adam@adalogics.com>
Co-authored-by: Oliver Chang <oliverchang@users.noreply.github.com>
2022-12-20 11:32:37 +11:00
Evgeny Vereshchagin 9781b78936
[infra] make coverage work and make it less chatty (#9235)
by passing the "o" option to unzip to prevent it from asking whether
files should be overwritten or not when it's run a few times in a row.

It's a follow-up to 7556698dbc

Closes https://github.com/google/oss-fuzz/issues/9234

@DavidKorczynski could you take a look?
2022-12-19 13:07:15 -05:00
Julia Hansbrough 3b054631ae
[docs] Update base-runner with coverage command. (#9212)
I noticed that base-runner *has* a coverage command but it wasn't
documented alongside the other commands, so, adding that here.
2022-12-19 10:44:16 -05:00
Khaled Yakdan b7ee58b26c
infra: remove temporary build image for Go (#9230)
Upstream Go 1.19 already contains all fuzzing improvements implemented
in the used Go fork.
2022-12-19 13:00:55 +11:00
DavidKorczynski f1593612c7
infra: bump and add java support in introspector (#9208)
Adds introspector support for java builds. Most of this work is
referenced by way of
https://github.com/ossf/fuzz-introspector/issues/536

Also bumps introspector, which comes with a fix for
https://github.com/ossf/fuzz-introspector/issues/679

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-12-18 15:51:44 -08:00
jonathanmetzman 40ed51071e
Fix download_corpora for centipede. (#9216) 2022-12-16 08:54:52 -05:00
jonathanmetzman c87906f379
[SystemSan] Add feature for opting out. (#9221)
Demonstrate usage to stop false postive from happening.
2022-12-15 14:24:30 -05:00
jonathanmetzman 4d8b1e6a87
Delete extra whitespace in coverage 2022-12-15 09:13:59 -05:00
jonathanmetzman 0303aab0b7
Fix symlink bug detection (#9215) 2022-12-15 08:38:18 -05:00
jonathanmetzman 19765d5963
Update helper.py 2022-12-14 11:48:35 -05:00
jonathanmetzman 01544e9538
WIP: allow running ClusterFuzzLite locally (#9087) 2022-12-14 11:23:15 -05:00
DavidKorczynski afd8a78b0b
infra: build: provide correct corpus name (#9189)
This is a follow-up to https://github.com/google/oss-fuzz/pull/9167 --
the change should also be applied in the build functions that are
responsible for downloading the corpus.

Signed-off-by: David Korczynski <david@adalogics.com>
2022-12-14 02:53:00 -08:00
Jonathan Metzman 2daac734e7 SystemSan: fix compiler errors 2022-12-14 04:51:05 -05:00
jonathanmetzman 91886878b2
SystemSan: POC of symbolic link attack (#9199) 2022-12-14 04:46:51 -05:00
jonathanmetzman 695e99329f
[NFC] Minor SysSan improvements (#9149) 2022-12-14 08:40:06 +11:00
Oliver Chang b8c6748c5e
SystemSan fixes. (#9153)
Fix multiple bugs with shell detection:
1. We weren't correctly extracting the argument to be passed to
readlink. We needed to take the null terminator into account, as we
extract this string from memory.
2. readlink does **not** null terminate the output. Fix this.
3. `binary_name.compare(0, 2, "sh")` for detecting if the binary is "sh"
was too liberal, and included "shell_injection_poc_fuzzer" because the
prefix matched.

Also reduce some very noisy debug logging.
2022-12-13 20:32:55 +11:00
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