* ghostscript: extend with eps2write device fuzzer
eps2write is one of the high-level devices currently not targeted by the
fuzzing suite. This adds a fuzzer for this high-level device.
* cleanup build
* ghostscript: add tiff fuzzer
Similar to all other devices with exception it writes to file instead of
/dev/null. This is needed because tiff writing requires seek abilities.
* ghostscript: add target for new devices
Adds ability to target various devices and a fuzzer that targets
pdfwrite and pxlmono devices. The primary device of interest here is
likely pdfwrite as it's more widely used as far as I know.
* fix review 1
* fix review 2
* nit
* nit
* ghostscript: extend fuzzing
- Add two new fuzzers
- One new fuzzer that explore multiple colorings
- One new fuzzer that focuses on PDF exploration
- Add dictionary to PDF fuzzer
- Add small sized PDF seed to PDF fuzzer
- Ensure max_len on multiple coloring fuzzing
* Add myself to auto_ccs
* Fix typo
* set indentation
* add options file
* Address review: split fuzzers and have dict + seed locally
* nit
* clarify prepending of single byte
* fix styling
* clarify comments in all_colors fuzzer
* Addess final review
These projects were tested and it was found that their use
of MSAN does not work on Ubuntu 20.04. Therefore their use of
MSAN is being disabled.
Related: #6180
This makes it easier to build the fuzzer using a locally checked
out git repo without having to manually copy the fuzzer glue code
into the locally checked out git repo first.
Valgrind may complain when software reads out partially uninitialized data
and stores it elsewhere, but only reads the initialized parts from this
latter location. The flag enables code that initializes all the data to
avoid valgrind reporting false positives. Presumably MSAN suffers from
similar issues so, try enabling this flag.
* [ghostscript] Replace deprecated flag by current flag.
In old versions of Ghostscript the flag -dPARANOIDSAFER did
more checks than -dSAFER did. In modern versions the two flags
are identical. Moreover the flag -dPARANOIDSAFER has been
deprecated for a long time, and may be removed in the future.
In Ghostscript 9.50 and later -dSAFER is the default, and does
not have to be specified. To be able to test older yet still
modern Ghostscript versions without problems -dSAFER is used.
* [ghostscript] Force enable banding while rendering.
Ghostscript uses the set resolution to determine if banding should be
enabled during rendering, or not. Under normal circumstances documents
are rendered at maybe 600 DPI, but to conserve memory while running in
OSS-fuzz 200 DPI is used (-r200x200). To still test the banding code
used under normal circumstances banding is force enabled.
Moreover BufferSpace is used to determine the band height and thus the
number of bands. At 600 DPI this is normally 4Mbyte, so a reasonable
approximate at 200 DPI is 450k. Thus BufferSpace is also set.
* [ghostscript] Enable another sanitizer to see more issues.
Previously raster output data was printed on stdout. While this
is similar to how Ghostscript is run by CUPS's gstoraster filter it
unnecessarily prolongs execution time for many files.
Changing the output file still means that CUPS will be sent the
rasterized page and will be asked to convert it to a PWG raster which
it then dutifully writes to /dev/null. Thus no major difference is
expected in what code is executed in Ghostscript (or CUPS).
When run locally on a testcase found among the problematic files here:
gs://ghostscript-corpus.clusterfuzz-external.appspot.com/libFuzzer/
fuzzer target reported a timeout after 120 seconds before this commit.
After this commit the fuzzer target succeeded after about 3 seconds.
* [presubmit] Enforce language attribute in projectt.yaml to be always set.
* Update documentation, better presubmit check, new project template.
* add docstring to templates.py
* Add example values in the project.yaml template and remove python value for now
* Add "project: c++" to 256 projects
* format
* Add labels and selective_unpack sections to the presubmit check
* fix incorrect auto_ccs format in three projects
* fix nss emails after rebase
When contributed to OSS-fuzz the Ghostscript target fuzzer was
licensed under a "BSD-style" license, referring to a LICENSE file
that actually contained an Apache 2.0 license! Recently the OSS-fuzz
project has added a presubmit check that validates the license of
each project's target fuzzer, causing the Ghostscript target fuzzer
to now fail the test. The Ghostscript target fuzzer therefore needs
to be relicensed under Apache 2.0.
This commit relicenses the existing target fuzzer code under
Apache 2.0 so that the Ghostscript target fuzzer code will pass
OSS-fuzz's presubmit checks allowing for further development.
The first element in the argument array to gsapi_new_instance()
is ignored since it normally is the program name. This means that
the commit introducing the "-K" argument to limit memory usage did
not have its intended effect since the "-K" argument was ignored.
Moreover, prior to that the resolution argument "-r200x200" was
being unintentionally ignored. By introducing a place holder program
name all arguments are taken into account and the reader is reminded
that the first argument is the program name.
* [ghostscript] Fix ininitialized pointer
Passing an invalid pointer causes a crash in gs_new_instance.
* [ghostscript] Add seed corpus
Use the examples distributed with ghostcript as a seed corpus.