1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00
Commit Graph

128528 Commits

Author SHA1 Message Date
Sara Golemon
7c28196a8a Partial revert of 6d96f39a68 2022-06-01 16:10:30 +00:00
Levi Morrison
280fd680c8 Make vm_interrupt and timed_out atomic (#8327)
This is done by adding a new zend_atomic_bool type. The type
definition is only available for compiler alignment and size info; it
should be treated as opaque and only the zend_atomic_bool_* family of
functions should be used.

Note that directly using atomic_bool is complicated. All C++ compilers
stdlibs that I checked typedef atomic_bool to std::atomic<bool>, which
can't be used in an extern "C" section, and there's at least one usage
of this in core, and probably more outside of it.

So, instead use platform specific functions, preferring compiler
intrinsics.
2022-06-01 09:43:25 -06:00
David Carlier
30c8f3a80f Fix GH-8674: sockets extension won't build for older Linux kernels
In abscence of the needed header, disable the feature altogether.

Closes GH-8677.
2022-06-01 17:33:36 +02:00
Máté Kocsis
ca6d1fd57b Merge branch 'PHP-8.1'
* PHP-8.1:
  Verify if generated func info is up-to-date
2022-06-01 17:10:56 +02:00
Máté Kocsis
0c3b411c6b Verify if generated func info is up-to-date 2022-06-01 17:08:28 +02:00
Máté Kocsis
9c446a9354 Declare ext/dom constants in stubs (#8676) 2022-06-01 16:14:08 +02:00
Máté Kocsis
a420ee6c34 Update PHP-Parser to 4.14
It supports readonly classes
2022-06-01 16:09:57 +02:00
Máté Kocsis
3de1613b98 Regenerate optimizer function info 2022-06-01 16:09:57 +02:00
Remi Collet
3670fa3b32 Merge branch 'PHP-8.1'
* PHP-8.1:
  use sha256 in openssl test suite
2022-06-01 11:46:59 +02:00
Remi Collet
03a4ccd912 use sha256 in openssl test suite 2022-06-01 11:46:47 +02:00
Máté Kocsis
2b6bfb0d80 Merge branch 'PHP-8.1'
* PHP-8.1:
  Get rid of invalid assertion and cleanup zend_call_method
2022-06-01 10:52:00 +02:00
Máté Kocsis
6d96f39a68 Get rid of invalid assertion and cleanup zend_call_method
Closes GH-8672
2022-06-01 10:50:50 +02:00
Sara Golemon
6c0a1db4a8 Merge branch 'PHP-8.1'
* PHP-8.1:
  Verify internal types before abandoning call frame
2022-06-01 00:52:30 +00:00
Sara Golemon
01d84545e7 Verify internal types before abandoning call frame
An internal caller executing a builtin method with
a static return type will lose context if we drop
our frame before performing the validation.
2022-06-01 00:51:08 +00:00
Kamil Tekiela
aa00fcad1c Merge branch 'PHP-8.1'
* PHP-8.1:
  Remove mysqli_close from clean_table.inc
2022-06-01 00:04:03 +01:00
Kamil Tekiela
7d65cc81f8 Remove mysqli_close from clean_table.inc
Backported from master. See https://github.com/php/php-src/pull/8427
2022-06-01 00:02:55 +01:00
George Peter Banyard
0e42ca2da7 [ci skip] Revert "Drop libmysql build from nightly" as PDO still accepts libmysql (#8664) 2022-05-31 20:24:38 +01:00
George Peter Banyard
ab67b52a59 [ci skip] Drop libmysql build from nightly (#8663)
There is no need to test this any more since support for it has been removed with 276e49c438
2022-05-31 11:30:11 +01:00
George Peter Banyard
fcba0a49fc Fix test file name to not include a whitespace
This breaks the preload file flag in the test runner
2022-05-31 11:28:01 +01:00
Christoph M. Becker
57add48777 Revert "Make socket path shorter for ext/sockets/tests/socket_cmsg_{rights|credentials}.phpt"
This reverts commit b0c1773686, since
this causes CI failures, apparently related to ZTS builds.
2022-05-31 11:22:04 +02:00
Christoph M. Becker
8e2c08c5c2 Mark Windows mail tests as conflicting
These tests are not (yet) supposed to be run in parallel.
2022-05-31 10:50:59 +02:00
Andy Postnikov
b0c1773686 Make socket path shorter for ext/sockets/tests/socket_cmsg_{rights|credentials}.phpt
When running in CI it fails when path/address is longer 108

Closes GH-8617.
2022-05-31 10:37:35 +02:00
Máté Kocsis
b7b5ad7169 Make ini_set invocation compatible with PHP 8.0 2022-05-31 08:52:35 +02:00
Chen, Hu
c1fcd45eeb JIT: Add IBT support (#8636)
Indirect Branch Tracking (IBT) is part of Intel's Control-Flow
Enforcement Technology (CET). IBT is hardware based, forward edge
Control-Flow-Integrity mechanism where any indirect CALL/JMP must target
an ENDBR instruction or suffer #CP.

This commit adds IBT support for JIT:
1. Add endbr32/64 instruction in Dynasm.
2. Insert endbr32/64 in indirect branch target for jitted code.

gcc support CET since v8.1 and set it to default since gcc 11. With this
commit, endbr is inserted in jitted code if PHP is compiled with "gcc
-fcf-protection=full/branch".

Signed-off-by: Chen, Hu <hu1.chen@intel.com>
2022-05-31 09:29:40 +03:00
Kamil Tekiela
2d1a320ba9 UPGRADING for libmysql change 2022-05-30 16:22:48 +01:00
Kamil Tekiela
23b0257fdc Remove tests for libmysql 2022-05-30 15:28:08 +01:00
Kamil Tekiela
01cbe390ca Remove mysqli_driver::$reconnect property 2022-05-30 15:28:08 +01:00
Kamil Tekiela
21ca8c43a8 The INI mysqli.reconnect directive has been removed. 2022-05-30 15:28:08 +01:00
Kamil Tekiela
d84dfa3292 Remove MYSQLI_USE_MYSQLND constant and all the code with it 2022-05-30 15:28:08 +01:00
Kamil Tekiela
276e49c438 Remove libmysql 2022-05-30 15:28:08 +01:00
David CARLIER
daba5fb43f fpm sockets set listen back queue size to negative which trim down (#8638)
to the SOMAXCONN hard limit on macOs.
2022-05-30 13:12:52 +01:00
George Peter Banyard
3bf4098eee Refactor (again) CLI SAPI server_client struct to use zend_string* (#8605)
This time in a way which works under a RC Debug build.
2022-05-30 13:03:23 +01:00
Dmitry Stogov
e2e2d29973 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix memory leak
2022-05-30 11:39:24 +03:00
Dmitry Stogov
7ebda198ea Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak
2022-05-30 11:39:10 +03:00
Dmitry Stogov
3a8912fb7c Fix memory leak
This fixes oss-fuzz #47648
2022-05-30 11:32:17 +03:00
George Peter Banyard
4db981b74e Session: Refactor basedir to be a zend_string in mod_files 2022-05-29 15:24:06 +01:00
George Peter Banyard
ec43006719 Session: Refactor last key to be a zend_string in mod_files 2022-05-29 15:24:06 +01:00
George Peter Banyard
8a1ca99aab Session: Use zend_string* consistently for key in mod_mm 2022-05-29 15:24:06 +01:00
George Peter Banyard
f872972584 Session: Use zend_string* consistently for key in mod_files 2022-05-29 15:24:06 +01:00
George Peter Banyard
4a5699ae2f Session: use more appropriate types 2022-05-29 15:24:06 +01:00
George Peter Banyard
d08451b2ca Replace php_stdint.h header with standard headers (#8613) 2022-05-29 11:20:56 +01:00
Alex Dowad
492021168d php_mb_convert_encoding{,_ex} returns zend_string
That's what all existing callers want anyways. This avoids 2
unnecessary copies of the converted string.
2022-05-28 21:53:39 +02:00
Alex Dowad
e2c4fc5755 Fix buffer overflow bugs in CP50222 text conversion code 2022-05-28 21:53:39 +02:00
Alex Dowad
1f17b5468f Fix buffer overflow bug in HZ text conversion code 2022-05-28 21:53:39 +02:00
Alex Dowad
0154a5ac9f Use fast text conversion filters to implement php_mb_convert_encoding_ex 2022-05-28 21:53:38 +02:00
Alex Dowad
8dddd3cfad Fix buffer overflow bugs in UTF-7 text conversion
After Nikita Popov found a buffer overrun bug in one of my pull
requests, I was prompted to add more assertions in a38c7e5703 to help
me catch such bugs myself more easily in testing.

Wouldn't you just know it... as soon as I added those assertions, the
mbstring test suite caught another buffer overrun bug in my UTF-7
conversion code, which I wrote the better part of a year ago.

Then, when I started fuzzing the code with libfuzzer, I found
and fixed another buffer overflow:

If we enter the main loop, which normally outputs 3 decoded Base64
characters, where the first half of a surrogate pair had appeared at
the end of the previous run, but the second half does not appear
on this run, we need to output one error marker.

Then, at the end of the main loop, if the Base64 input ends at an
unexpected position AND the last character was not a legal
Base64-encoded character, we need to output two error markers
for that. The three error markers plus two valid, decoded bytes
can push us over the available space in our wchar buffer.
2022-05-28 21:53:38 +02:00
Alex Dowad
e4b9aa1870 Add assertions to help catch buffer overflows in mbstring text conversion code 2022-05-28 21:53:38 +02:00
Alex Dowad
a789088527 Add more tests for mbstring encoding conversion
When testing the preceding commits, I used a script to generate a large
number of random strings and try to find strings which would yield
different outputs from the new and old encoding conversion code.
Some were found. In most cases, analysis revealed that the new code
was correct and the old code was not.

In all cases where the new code was incorrect, regression tests were
added. However, there may be some value in adding regression tests
for cases where the old code was incorrect as well. That is done here.

This does not cover every case where the new and old code yielded
different results. Some of them were very obscure, and it is proving
difficult even to reproduce them (since I did not keep a record of
all the input strings which triggered the differing output).
2022-05-28 21:53:38 +02:00
Alex Dowad
b2f963f91c For JIS/ISO-2022-JP, treat a truncated escape sequence as error 2022-05-28 21:53:37 +02:00
Alex Dowad
4afa72126e Implement fast text conversion interface for QPrint 2022-05-28 21:53:37 +02:00