Commit graph

26 commits

Author SHA1 Message Date
Niels Dossche
1fe7dc31ef
Fix -Wstrict-prototypes warnings in fuzzer SAPI (#11277) 2023-05-20 11:43:30 +02:00
Dmitry Stogov
5c5707d44d Make fuzzer respect ZEND_MMAP_AHEAD
Fixes oss-fuzz #55654
2023-02-07 13:13:05 +03:00
Max Kellermann
d53ad4b566 main/SAPI: make "ini_entries" a const string 2023-01-04 12:49:48 +00:00
George Peter Banyard
b5db594fd2
Refacto php_module_startup() (#8303)
It only ever uses at most 1 additional modules
2022-04-27 23:07:11 +01:00
Nikita Popov
b7409d3a63 Disable chdir in execute fuzzers
We don't want the current working directory to change during
fuzzing, as that breaks corpus access unless an absolute path is
used. I'm not sure why this issue never came up before.
2021-09-22 12:58:20 +02:00
Nikita Popov
cd4243dde9 Add fuzzer for function JIT
This is a basic fuzzer for the function JIT, which looks for
crashes and sanitizer violations only, and does not try to detect
differing behavior yet.
2021-09-15 17:12:39 +02:00
Nikita Popov
0f926815ca Fix strict-prototypes warning 2021-08-30 10:43:21 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
dfe8dbdc0d Destroy file handle earlier in execute fuzzer
I'm not quite sure why this is relevant, but if matches what other
code does and fixes oss-fuzz #32517.
2021-04-15 12:55:58 +02:00
Nikita Popov
5da23eb46c Free static variables in execute fuzzer
Fixes a leak in the seed corpus.
2021-03-26 11:59:14 +01:00
Dmitry Stogov
c732ab400a Change Zend Stream API to use zend_string* instead of char*.
This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERNALS.
2021-03-16 20:31:36 +03:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
2f95af996f Disable InfiniteIterator class while fuzzing
The combination of LimitIterator and InfiniteIterator can cause
effectively infinite loops that bypass the executor step limit.
2020-09-04 10:59:55 +02:00
Nikita Popov
05cd31ef64 Extend function blacklist in execute fuzzer
Add pfsockopen and stream_socket_server.
2020-09-02 17:30:19 +02:00
Nikita Popov
bb1d0319d7 Fix typo
This was supposed to include the header, not the C file...
2020-08-27 16:57:09 +02:00
Nikita Popov
a88226d116 Generate execute corpus in generate_all.php
And add crypt() to the function blacklist, it can be very slow.
2020-08-27 16:34:36 +02:00
Nikita Popov
c29838c561 Add experimental "execute" fuzzer
This is an end-to-end fuzzer that executes arbitrary PHP code.

We replace the executor with a finite-step executor to avoid
getting stuck in loops or recursion.
2020-08-27 13:06:24 +02:00
Nikita Popov
b0b836175c Extract some common fuzzer code 2020-06-30 15:05:02 +02:00
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Christoph M. Becker
dabc28d182 Fix #78880: Spelling error report
We fix the most often occuring typos according to a recent codespell
report[1] in tests, code comments and documentation.

[1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
2019-12-21 11:58:00 +01:00
Nikita Popov
991a0250b5 Reduce oniguruma retry limit in fuzzer
For some patterns matching may take quite long even at retry limit
100000 and it seems that this is not easy to fix on the oniguruma
side.

Reduce the retry limit by another factor of 10 in hope of reducing
timeouts.
2019-11-02 10:40:41 +01:00
Nikita Popov
bd21e202b9 Reduce oniguruma limits in fuzzing sapi
The defaults are fairly conservative and may still take quite a
bit to match a single expression. Reduce them by a factor of 10x
to speed up fuzzing.
2019-10-08 17:38:49 +02:00
Nikita Popov
7e295da81c Limit max length for parser fuzzer
We're getting some very large inputs (~500KB) on OSS-Fuzz, which
slot down performance a lot. Let's try limiting this, starting
with a still fairly large value of 64KB.

Also remove the max_execution_time limit, so that slow test cases
cause a genuine libfuzzer timeout and we may investigate them.
2019-09-26 10:45:47 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
c4e2ca607f Various improvements to fuzzer SAPIs 2019-09-16 16:04:10 +02:00
Stanislav Malyshev
41f45647f9 Add fuzzer SAPIs to the core 2019-09-16 16:04:09 +02:00