1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 06:02:23 +02:00
Commit Graph

5986 Commits

Author SHA1 Message Date
David Carlier
cb3d858745 Fix buffer allocations in zlog_stream_set_msg_suffix()
If that code was used, there would be a UAF scenario.

Closes GH-7835.
2021-12-28 13:27:54 +01:00
Tyson Andre
9a59417445 [skip ci] Document how to quickly check if jit .dasc files transpile, how to test the jit in different architectures. (#7768) 2021-12-19 10:12:35 -05:00
Jakub Zelenka
c4a1c0c18c Merge branch 'PHP-8.1' 2021-11-27 22:43:37 +00:00
Jakub Zelenka
a529d0dd15 Merge branch 'PHP-8.0' into PHP-8.1 2021-11-27 22:39:51 +00:00
Jakub Zelenka
81513e6285 Add skip for FPM process idle flaky test 2021-11-27 22:37:43 +00:00
Nikita Popov
902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Remi Collet
bc9d604430 Merge branch 'PHP-8.1'
* PHP-8.1:
  fix [-Wstrict-prototypes] buid warnings
2021-11-24 14:55:30 +01:00
Remi Collet
ef2fd0e5b5 fix [-Wstrict-prototypes] buid warnings 2021-11-24 14:55:11 +01:00
Dmitry Stogov
067df26344 Use memrchr() when available
On x86_64 glibc memrchr() uses SSE/AVX CPU extensions and works much
faster then naive loop. On x86 32-bit we still use inlined version.

memrchr() is a GNU extension. Its prototype  becomes available when
<string.h> is included with defined _GNU_SOURCE macro. Previously, we
defined it in "php_config.h", but some sources may include <string.h>
befire it. To avod mess we also pass -D_GNU_SOURCE to C compiler.
2021-11-24 16:13:34 +03:00
Nikita Popov
7cbf4bde3e Merge branch 'PHP-8.1'
* PHP-8.1:
  Add FPM test for php_admin_value doc_root usage
  Fix for bug in file handling refactor.
2021-11-23 18:36:45 +01:00
Jakub Zelenka
435a5aca89 Add FPM test for php_admin_value doc_root usage
Closes GH-7673.
2021-11-23 18:36:04 +01:00
Dmitry Stogov
ae5498c929 Fixed typo 2021-11-23 15:34:12 +03:00
Jakub Zelenka
636e54a1cb Merge branch 'PHP-8.1' 2021-11-20 20:44:41 +00:00
Jakub Zelenka
79f0e486fd Merge branch 'PHP-8.0' into PHP-8.1 2021-11-20 20:44:02 +00:00
Jakub Zelenka
2f8407f185 Increase read timeout in FPM process idle test 2021-11-20 20:42:19 +00:00
Jakub Zelenka
fc67967190 Increase script sleep in FPM process idle test 2021-11-20 20:42:19 +00:00
Nikita Popov
3ded2db0d2 Merge branch 'PHP-8.1'
* PHP-8.1:
  Update reflection test after stub change
2021-11-18 11:16:51 +01:00
Nikita Popov
36d2d27980 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Update reflection test after stub change
2021-11-18 11:16:35 +01:00
Nikita Popov
e81ad637f4 Update reflection test after stub change 2021-11-18 11:16:13 +01:00
Dmitry Stogov
ab5e908017 Fixed compilation warnings in 32-bit build 2021-11-15 10:20:03 +03:00
Jakub Zelenka
14db5fab11 Merge branch 'PHP-8.1' 2021-11-14 20:16:44 +00:00
Jakub Zelenka
48bc4ea758 Merge branch 'PHP-8.0' into PHP-8.1 2021-11-14 20:14:22 +00:00
Jakub Zelenka
ec3d4409a4 Merge branch 'PHP-7.4' into PHP-8.0 2021-11-14 20:10:42 +00:00
Jakub Zelenka
b2cf9b7ec7 Fix bug #81513 (Future possibility for heap overflow in FPM zlog)
This fixes currently unused code path in zlog that could lead to
the heap overflow in the future.
2021-11-14 20:08:57 +00:00
Nikita Popov
e964c91bce Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix leaks for AppArmor based distros in case the profile creation fails
2021-11-12 14:26:16 +01:00
Nikita Popov
4a5d75e3ec Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix leaks for AppArmor based distros in case the profile creation fails
2021-11-12 14:26:03 +01:00
David Carlier
b1e6fdefd4 Fix leaks for AppArmor based distros in case the profile creation fails
Closes GH-7646.
2021-11-12 14:25:52 +01:00
Nikita Popov
edc02d2d94 Merge branch 'PHP-8.1'
* PHP-8.1:
  Implement Stringable automatically for internal classes
2021-11-05 10:24:07 +01:00
Nikita Popov
b0ec6223e2 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Implement Stringable automatically for internal classes
2021-11-05 10:23:23 +01:00
Nikita Popov
b302bfabe7 Implement Stringable automatically for internal classes
Requiring all internal classes (including those from 3rd-party
extensions) to implement Stringable if they provide __toString()
is too error prone. Case in point, our _ZendTestClass test class
was not doing so, resulting in preloading test failures after
recent changes.

Instead we automatically implement Stringable, the same as we do
for userland classes. We still allow explicit implementations,
but ignore them (normally they would result in an error due to
duplicate interface implementation). Finally, we need to be
careful about not trying to implement Stringable on Stringable
itself.

In some cases this changes the interface order, in particular the
automatic Stringable implementation will now come first.
2021-11-05 10:22:04 +01:00
David CARLIER
1de405907d fpm allow process tracing/core dump on solaris systems. (#7548) 2021-11-03 22:26:43 +00:00
Dmitry Stogov
90b7bde615 Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
  instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
  familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
  (ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
  (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
  ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
    - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
    - zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Nikita Popov
a1285978d4 Merge branch 'PHP-8.1'
* PHP-8.1:
  Print array defaults in reflection
2021-10-20 15:17:08 +02:00
Nikita Popov
fb5cff1272 Print array defaults in reflection
As a followup to f34114b1fb print
the contents of arrays rather than just a generic "Array" marker.
Also drop the truncation on strings. As we no longer resolve
constants, there should be less concerns about printing very
large strings here. If someone thought it was a good idea to use
a 10k character strings as a default value in code, then it should
be fine for us to print it in reflection as well.
2021-10-20 15:16:29 +02:00
Stanislav Malyshev
9ab3bc69e8 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
  Add FPM fix news
  Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
2021-10-18 15:34:20 -07:00
Stanislav Malyshev
0acfd2d7b5 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
  Add FPM fix news
  Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
2021-10-18 15:23:08 -07:00
Jakub Zelenka
fadb1f8c1d Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
The main change is to store scoreboard procs directly to the variable sized
array rather than indirectly through the pointer.

Signed-off-by: Stanislav Malyshev <stas@php.net>
2021-10-18 15:06:36 -07:00
Nikita Popov
4cdcbc828f Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix some FPM printf warnings on openbsd
2021-10-18 11:12:23 +02:00
David Carlier
f71810fb6f Fix some FPM printf warnings on openbsd
Closes GH-7585.
2021-10-18 11:11:33 +02:00
Jakub Zelenka
cb2021e5f6 Fix bug #81026 (PHP-FPM oob R/W in root process leading to priv escalation)
The main change is to store scoreboard procs directly to the variable sized
array rather than indirectly through the pointer.

Signed-off-by: Stanislav Malyshev <stas@php.net>
2021-10-17 20:16:10 -07:00
Christoph M. Becker
e22b305ffb Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #81518: Header injection via default_mimetype / default_charset
2021-10-14 12:24:05 +02:00
Christoph M. Becker
f99c69fc2e Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81518: Header injection via default_mimetype / default_charset
2021-10-14 12:23:43 +02:00
Christoph M. Becker
b7f3b67060 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81518: Header injection via default_mimetype / default_charset
2021-10-14 12:21:35 +02:00
Christoph M. Becker
365769366b Fix #81518: Header injection via default_mimetype / default_charset
We forbid setting these INI options to values containing NUL bytes, CR
or LF.

Closes GH-7574.
2021-10-14 12:16:19 +02:00
Nikita Popov
39a1cab471 Generate tracing jit corpus in generate_all.php
Using same corpus as function jit. To allow oss-fuzz integration.
2021-10-11 14:33:11 +02:00
Joe Watkins
0603d3b2e2 improve configuration of pthread link for userfaultd thread under NTS (#7568) 2021-10-11 12:57:41 +02:00
Bob Weinand
ad9c10b47b Prefer userfaultfd over mprotect+SIGSEGV signal handling on linux for phpdbg watchpoints
Closes GH-7551.
2021-10-08 21:05:43 +02:00
Nikita Popov
5d05f810d0 Reduce max input size in parser fuzzer
Still seeing stack overflows for $$$$$x style input, let's reduce
the input size limit further...
2021-10-06 19:14:20 +02:00
Kamil Tekiela
10f102d790 Fix 'can not' in error messages 2021-10-05 09:51:58 +01:00
Joe Watkins
e829284b53 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #81496: CLI server logs wrong request method
2021-10-05 08:43:38 +02:00