glib2.0/fuzzing
Yue-Lan fdfffcefec New upstream version 2.78.0 2024-02-29 14:32:35 +08:00
..
README.md New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
driver.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz.h New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_bookmark.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_bookmark.corpus Import Upstream version 2.64.2 2022-06-29 16:02:05 +08:00
fuzz_canonicalize_filename.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_date_parse.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_date_time_new_from_iso8601.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_dbus_message.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_inet_address_mask_new_from_string.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_inet_address_new_from_string.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_inet_socket_address_new_from_string.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_key.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_key.corpus Import Upstream version 2.64.2 2022-06-29 16:02:05 +08:00
fuzz_network_address_parse.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_network_address_parse_uri.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_paths.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_resolver.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_uri_escape.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_uri_parse.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_uri_parse_params.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_utf8_normalize.c New upstream version 2.78.0 2024-02-29 14:32:35 +08:00
fuzz_utf8_validate.c New upstream version 2.78.0 2024-02-29 14:32:35 +08:00
fuzz_uuid_string_is_valid.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_variant_binary.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_variant_binary_byteswap.c New upstream version 2.78.0 2024-02-29 14:32:35 +08:00
fuzz_variant_text.c New upstream version 2.74.5 2023-02-14 16:00:02 +08:00
fuzz_variant_text.dict Import Upstream version 2.64.2 2022-06-29 16:02:05 +08:00
meson.build New upstream version 2.78.0 2024-02-29 14:32:35 +08:00

README.md

Fuzz targets used by oss-fuzz.

Useful links: Dashboard (requires access), Build logs, Coverage

How to add new targets

Add fuzz_target_name.c and edit meson.build accordingly.

New targets are picked up by oss-fuzz automatically within a day. Targets must not be renamed once added.

Add (optional) fuzz_target_name.dict containing keywords and magic bytes.

Add (optional) fuzz_target_name.corpus with file names on separate lines. Wildcards ?, * and ** are supported. Examples below.

glib/*  # all files in directory glib
glib/** # all files in directory glib and sub-directories
**.xbel # all files ending with .xbel in the repository

Recommended reading: Fuzz Target, Dictionaries, Corpus

How to reproduce oss-fuzz bugs locally

Build with at least the following flags, choosing a sanitizer as needed. A somewhat recent version of clang is recommended.

$ CC=clang CXX=clang++ meson DIR -Db_sanitize=<address|undefined> -Db_lundef=false

Afterwards run the affected target against the provided test case.

$ DIR/fuzzing/fuzz_target_name FILE

FAQs

What about Memory Sanitizer (MSAN)?

Correct MSAN instrumentation is difficult to achieve locally, so false positives are very likely to mask the actual bug.

If need be, you can still reproduce those bugs with the oss-fuzz provided docker images.

There are no file/function names in the stack trace.

llvm-symbolizer must be in PATH.

UndefinedBehavior Sanitizer (UBSAN) doesn't provide a stack trace.

Set environment variable UBSAN_OPTIONS to print_stacktrace=1 prior to running the target.